1#ifndef NET_InternetSocket_h__
2#define NET_InternetSocket_h__
4#include "SimpleSocket.h"
43 void connect( std::string_view foreignAddress,
unsigned short foreignPort);
57 int timedConnect( std::string_view foreignAddress,
unsigned short foreignPort,
int timeout);
64 void bind(
unsigned short localPort = 0);
86 void bind( std::string_view localAddress,
unsigned short localPort = 0);
127 AddressFamily m_family;
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 setReuseAddress(bool enable)
Enable or disable local address reuse.
AddressFamily addressFamily() const noexcept
return wether this socket was created for IPv4 or IPv6
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