Typedefs |
typedef int | Handle |
| posix socket type. More...
|
Enumerations |
enum | ErrorCodes {
errOk,
errGeneric,
errInitError,
errConnectionClosed,
errUnbound,
errNotListening,
errBadAddress
} |
Functions |
int | init () |
| initializes the environment. it _MUST_ be called _before_ any other sockets function. More...
|
int | cleanup () |
| cleans up the environment. it _MUST_ be called after there's no more need for sockets. More...
|
int | open (Handle &handle, int pf, int type) |
| creates a socket. More...
|
int | close (Handle handle) |
| close a file. More...
|
int | connect (Handle handle, const char *to, int pf, u_short port) |
| establish a connection with a peer. More...
|
int | send (Handle handle, const char *buffer, long len, int flags, long &bytesSent) |
| sends data on a connected socket. More...
|
int | sendTo (Handle handle, const char *buffer, long len, int flags, const char *to, int pf, u_short port, long &bytesSent) |
| sends data to a specific destination ( most likely to be used in combination with connectionless protocols ). More...
|
int | recv (Handle handle, char *buffer, long len, int flags, long &bytesReceived) |
| tries to receive data from a connected socket. More...
|
int | recvFrom (Handle handle, char *buffer, long len, int flags, char *from, int pf, u_short port, long &bytesReceived) |
| receives a datagram and stores the source address. More...
|
int | bind (Handle handle, int pf, u_short port) |
| associates a local address with a socket. More...
|
int | listen (Handle handle, int backlog=SOMAXCONN) |
| puts the socket into listening state for incoming connections. More...
|
int | accept (Handle &newHandle, Handle handle) |
| accept a connection on a socket. More...
|
int | setBlocking (Handle handle, bool blocking) |
| control the mode of a socket. More...
|
int | getServicePort (const char *service, u_short &port) |
int | flush (Handle handle) |
| flush socket buffers. More...
|
const char * | message (int index) |
| translates error codes to human readable error messages. More...
|
Variables |
const int | MAX_ERROR_CODE = 6 |
const char * | messagesTable [MAX_ERROR_CODE+1] |
const int | pfINET = AF_INET |
| the network protocol family categories. More...
|
const int | pfUNIX = AF_UNIX |
| the network protocol family categories. More...
|
const int | pfIPX = AF_IPX |
| the network protocol family categories. More...
|
const int | stSTREAM = SOCK_STREAM |
| connection oriented and conectionless socket types. More...
|
const int | stDGRAM = SOCK_DGRAM |
| connection oriented and conectionless socket types. More...
|
const int | flagPEEK = MSG_PEEK |
| flags for use with send()/sendto()/recv()/recvfrom(). More...
|
const int | flagOOB = MSG_OOB |
| flags for use with send()/sendto()/recv()/recvfrom(). More...
|
const Handle | NULL_HANDLE = -1 |
| a handle value designating an invalid handle. More...
|