19 m_message += strerror(m_errorcode);
26 if( (
m_socket = ::socket( domain, type, protocol)) < 0)
35 throw SocketException(
"Tried to initialize Socket with invalid Handle",
false);
73 poll.events = POLLIN | POLLPRI | POLLRDHUP;
77 if( ret == 0)
return 0;
80 if( poll.revents & POLLRDHUP)
83 if( poll.revents & POLLIN || poll.revents & POLLPRI)
96 std::memset( &addr, 0,
sizeof(addr));
97 addr.sa_family = AF_UNSPEC;
99 if( ::connect(
m_socket, &addr,
sizeof(addr)) < 0)
101 if( errno != ECONNRESET)
#define TEMP_FAILURE_RETRY(expression)
Signals a problem with the execution of a socket call.
SocketException(std::string_view message, bool inclSysMsg=true)
int timedReceive(void *buffer, size_t len, int timeout)
receive data from a bound socket, return after the given timespan
void disconnect()
Disconnect and unset any foreign addresses.
void shutdown(ShutdownDirection type)
shutdown the connection in the specified direction
int send(const void *buffer, size_t len)
send data through a connected socket
bool peerDisconnected() const
returns whether a peer disconnected
SimpleSocket(int sockfd)
enables return of an accepted socket
int receive(void *buffer, size_t len)
receive data from a bound socket