1#ifndef _XMLRPCSOCKET_H_
2#define _XMLRPCSOCKET_H_
7# pragma warning( disable : 4786 )
32 static bool nbWrite(
int socket, std::string&
s,
int* bytesSoFar );
50 static bool connect(
int socket, std::string& host,
int port );
A platform-independent socket API.
static int socket()
Creates a stream (TCP) socket. Returns -1 on failure.
static bool listen(int socket, int backlog)
Set socket in listen mode.
static int getError()
Returns last errno.
static int accept(int socket)
Accept a client connection request.
static bool nbWrite(int socket, std::string &s, int *bytesSoFar)
Write text to the specified socket. Returns false on error.
static bool setReuseAddr(int socket)
static bool connect(int socket, std::string &host, int port)
Connect a socket to a server (from a client).
static bool setNonBlocking(int socket)
Sets a stream (TCP) socket to perform non-blocking IO. Returns false on failure.
static void close(int socket)
Closes a socket.
static bool nbRead(int socket, std::string &s, bool *eof)
Read text from the specified socket. Returns false on error.
static bool bind(int socket, int port)
Bind to a specified port.
static std::string getErrorMsg()
Returns message corresponding to last error.