]> git.tdb.fi Git - libs/net.git/blob - source/net/unix.h
Add a dynamic receiver class for more flexible packet handling
[libs/net.git] / source / net / unix.h
1 #ifndef MSP_NET_UNIX_H_
2 #define MSP_NET_UNIX_H_
3
4 #include "mspnet_api.h"
5 #include "sockaddr.h"
6
7 namespace Msp {
8 namespace Net {
9
10 class MSPNET_API UnixAddr: public SockAddr
11 {
12 private:
13         std::string path;
14         bool abstract = false;
15
16 public:
17         UnixAddr() = default;
18         UnixAddr(const SysAddr &);
19         UnixAddr(const std::string &, bool = false);
20
21         UnixAddr *copy() const override { return new UnixAddr(*this); }
22
23         SysAddr to_sys() const override;
24
25         Family get_family() const override { return UNIX; }
26         std::string str() const override;
27 };
28
29 } // namespace Net
30 } // namespace Msp
31
32 #endif