simple-socket library 1.2.0
UnixSocket.h
Go to the documentation of this file.
1#ifndef NET_UnixSocket_h__
2#define NET_UnixSocket_h__
3
4#include "SimpleSocket.h"
5
6struct sockaddr_un;
7
8namespace NET
9{
11
14 class UnixSocket : public SimpleSocket
15 {
16 public:
22 void connect( std::string_view foreignPath);
23
29 void bind( std::string_view localPath);
30
36 std::string getLocalPath() const;
37
43 std::string getForeignPath() const;
44
45 protected:
47 UnixSocket( int type, int protocol);
48
57 static void fillAddress( std::string_view path, sockaddr_un& addr);
58
60 static std::string extractPath( const sockaddr_un& addr, socklen_t len);
61 };
62
63} // namespace NET
64
65#endif // NET_UnixSocket_h__
static const int len
Definition CANFrame.h:7
SimpleSocket(int sockfd)
enables return of an accepted socket
void connect(std::string_view foreignPath)
static std::string extractPath(const sockaddr_un &addr, socklen_t len)
extracts a path string from the socket address structure
static void fillAddress(std::string_view path, sockaddr_un &addr)
std::string getForeignPath() const
UnixSocket(int type, int protocol)
allows a subclass to create new socket
void bind(std::string_view localPath)
std::string getLocalPath() const