1#ifndef NET_InternetSocket_h__
2#define NET_InternetSocket_h__
34 void connect( std::string_view foreignAddress,
unsigned short foreignPort);
45 int timedConnect( std::string_view foreignAddress,
unsigned short foreignPort,
int timeout);
52 void bind(
unsigned short localPort = 0);
74 void bind( std::string_view localAddress,
unsigned short localPort = 0);
121 static void fillAddress( std::string_view address,
unsigned short port, sockaddr_in& addr);
void bind(unsigned short localPort=0)
unsigned short getLocalPort() const
unsigned short getForeignPort() const
InternetSocket(int sockfd)
create socket from a SocketHandle returned by an accept() call
int timedConnect(std::string_view foreignAddress, unsigned short foreignPort, int timeout)
establish a connection with the given foreign address and port
void connect(std::string_view foreignAddress, unsigned short foreignPort)
establish a connection with the given foreign address and port
std::string getLocalAddress() const
std::string getForeignAddress() const
static void fillAddress(std::string_view address, unsigned short port, sockaddr_in &addr)
SimpleSocket(int sockfd)
enables return of an accepted socket