A platform-independent socket API. More...
#include <XmlRpcSocket.h>
Static Public Member Functions | |
static int | accept (int socket) |
Accept a client connection request. | |
static bool | bind (int socket, int port) |
Bind to a specified port. | |
static void | close (int socket) |
Closes a socket. | |
static bool | connect (int socket, std::string &host, int port) |
Connect a socket to a server (from a client) | |
static int | get_port (int socket) |
static int | getError () |
Returns last errno. | |
static std::string | getErrorMsg () |
Returns message corresponding to last error. | |
static std::string | getErrorMsg (int error) |
Returns message corresponding to error. | |
static bool | listen (int socket, int backlog) |
Set socket in listen mode. | |
static bool | nbRead (int socket, std::string &s, bool *eof) |
Read text from the specified socket. Returns false on error. | |
static bool | nbWrite (int socket, std::string &s, int *bytesSoFar) |
Write text to the specified socket. Returns false on error. | |
static bool | setNonBlocking (int socket) |
Sets a stream (TCP) socket to perform non-blocking IO. Returns false on failure. | |
static bool | setReuseAddr (int socket) |
static int | socket () |
Creates a stream (TCP) socket. Returns -1 on failure. |
A platform-independent socket API.
Definition at line 23 of file XmlRpcSocket.h.
int XmlRpcSocket::accept | ( | int | socket | ) | [static] |
Accept a client connection request.
Definition at line 162 of file XmlRpcSocket.cpp.
bool XmlRpcSocket::bind | ( | int | socket, |
int | port | ||
) | [static] |
Bind to a specified port.
Definition at line 142 of file XmlRpcSocket.cpp.
void XmlRpcSocket::close | ( | int | socket | ) | [static] |
Closes a socket.
Definition at line 106 of file XmlRpcSocket.cpp.
bool XmlRpcSocket::connect | ( | int | socket, |
std::string & | host, | ||
int | port | ||
) | [static] |
Connect a socket to a server (from a client)
Definition at line 179 of file XmlRpcSocket.cpp.
int XmlRpcSocket::get_port | ( | int | socket | ) | [static] |
Definition at line 325 of file XmlRpcSocket.cpp.
int XmlRpcSocket::getError | ( | ) | [static] |
Returns last errno.
Definition at line 295 of file XmlRpcSocket.cpp.
std::string XmlRpcSocket::getErrorMsg | ( | ) | [static] |
Returns message corresponding to last error.
Definition at line 307 of file XmlRpcSocket.cpp.
std::string XmlRpcSocket::getErrorMsg | ( | int | error | ) | [static] |
Returns message corresponding to error.
Definition at line 314 of file XmlRpcSocket.cpp.
bool XmlRpcSocket::listen | ( | int | socket, |
int | backlog | ||
) | [static] |
Set socket in listen mode.
Definition at line 155 of file XmlRpcSocket.cpp.
bool XmlRpcSocket::nbRead | ( | int | socket, |
std::string & | s, | ||
bool * | eof | ||
) | [static] |
Read text from the specified socket. Returns false on error.
Definition at line 232 of file XmlRpcSocket.cpp.
bool XmlRpcSocket::nbWrite | ( | int | socket, |
std::string & | s, | ||
int * | bytesSoFar | ||
) | [static] |
Write text to the specified socket. Returns false on error.
Definition at line 265 of file XmlRpcSocket.cpp.
bool XmlRpcSocket::setNonBlocking | ( | int | socket | ) | [static] |
Sets a stream (TCP) socket to perform non-blocking IO. Returns false on failure.
Definition at line 120 of file XmlRpcSocket.cpp.
bool XmlRpcSocket::setReuseAddr | ( | int | socket | ) | [static] |
Allow the port the specified socket is bound to to be re-bound immediately so server re-starts are not delayed. Returns false on failure.
Definition at line 132 of file XmlRpcSocket.cpp.
int XmlRpcSocket::socket | ( | ) | [static] |
Creates a stream (TCP) socket. Returns -1 on failure.
Definition at line 98 of file XmlRpcSocket.cpp.