23 const char* buf =
static_cast<const char*
>(buffer) + sent;
24 int ret =
send( buf,
len - sent);
25 if( ret < 0)
return ret;
26 sent +=
static_cast<unsigned>(ret);
35 throw SocketException(
"listen failed, most likely another socket is already listening on the same port");
54 if( ret == 0)
return Handle();
#define TEMP_FAILURE_RETRY(expression)
InternetSocket(int sockfd)
create socket from a SocketHandle returned by an accept() call
Signals a problem with the execution of a socket call.
int send(const void *buffer, size_t len)
send data through a connected socket
SocketHandle< TCPSocket > Handle
Handle for a new socket returned by accept.
int sendAll(const void *buffer, size_t len)
send data through a connected socket
void listen(int backlog=5)
listen for incoming connections
Handle timedAccept(int timeout) const
wait for another socket to connect
Handle accept() const
wait for another socket to connect