]> git.tdb.fi Git - libs/net.git/blob - source/net/inet.h
Implement an asynchronous name resolver class
[libs/net.git] / source / net / inet.h
1 #ifndef MSP_NET_INET_H_
2 #define MSP_NET_INET_H_
3
4 #include "sockaddr.h"
5
6 namespace Msp {
7 namespace Net {
8
9 /**
10 Address class for IPv4 sockets.
11 */
12 class InetAddr: public SockAddr
13 {
14 private:
15         unsigned char addr[4];
16         unsigned port;
17
18 public:
19         InetAddr();
20         InetAddr(const SysAddr &);
21
22         virtual InetAddr *copy() const { return new InetAddr(*this); }
23
24         virtual SysAddr to_sys() const;
25
26         virtual Family get_family() const { return INET; }
27         unsigned get_port() const { return port; }
28         virtual std::string str() const;
29 };
30
31 } // namespace Net
32 } // namespace Msp
33
34 #endif