2#include "SockAddress.h"
10: SimpleSocket( AF_UNIX, type, protocol)
17UnixSocket::~UnixSocket()
19 if( !m_boundPath.empty())
20 ::unlink( m_boundPath.c_str());
27 if(
::connect( m_socket, addr.data(), addr.length()) < 0)
30 m_peerDisconnected =
false;
37 if(
::bind( m_socket, addr.data(), addr.length()) < 0)
40 m_boundPath = localPath;
47 if( ::getsockname( m_socket, addr.data(), addr.lengthPtr()) < 0)
50 return addr.address();
57 if( ::getpeername( m_socket, addr.data(), addr.lengthPtr()) < 0)
60 return addr.address();
Signals a problem with the execution of a socket call.
void connect(std::string_view foreignPath)
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