#include <XPSocketClass.h>

Public Member Functions | |
| XPSocket () | |
| virtual | ~XPSocket () |
| virtual int | Create (void) |
| int | Connect (const XPAddress &addr) |
| int | Send (const char *data) |
| int | Send (const char *data, const int len) |
| int | Recv (char *const data, const int maxlen) |
| int | Close (void) |
| int | Listen (const int port=XPSOCK_PORT_ANY) |
| int | Listen (const XPAddress &addr) |
| XPSocket * | Accept (void) |
| int | SetSendBuffer (const int size) |
| int | SetRecvBuffer (const int size) |
| int | GetAddress (XPAddress *const addr) |
| int | GetPeerAddress (XPAddress *const addr) |
| int | MutateSocket (XPSocket *socket) |
| bool | IsAlive (void) |
| t_XPSocket * | GetSocketPointer (void) |
Static Public Member Functions | |
| static int | GetLastError (void) |
| static int | GetMaxPacketSize (void) |
Friends | |
| class | XPSocketUrgent |
| XPSocket | ( | ) |
The ctor for an XPSocket This checks to make sure sockets are active and sets some initial states. At this point no connection is made for the socket
| int GetLastError | ( | void | ) | [static] |
Gets the last error reported by the XPSocket API
| int Create | ( | void | ) | [virtual] |
Creates a TCP style socket. This is the first stage to creating a connection
Reimplemented in XPStream.
| int Connect | ( | const XPAddress & | addr | ) |
Tries to connect this socket to a network address
| addr | the address to try to connect to |
| int Send | ( | const char * | data | ) |
Sends a NULL terminated string to the peer (the connected machine) for this socket
| data | The pointer to the NULL terminated string |
| int Send | ( | const char * | data, | |
| const int | len | |||
| ) |
Sends data to the peer (the connected machine) for this socket
| data | the pointer to the data to send | |
| len | the length of the data to send |
Reimplemented in XPStream.
| int Recv | ( | char *const | data, | |
| const int | maxlen | |||
| ) |
Tries to receive data that is waiting for this socket
| data | the pointer to the buffer to receive the data | |
| maxlen | the maximum length of the data buffer |
Reimplemented in XPStream.
| int Close | ( | void | ) |
| int Listen | ( | const int | port = XPSOCK_PORT_ANY |
) |
Makes the socket listen on a certain port number
| port | the port number to listen on for incoming connections |
| int Listen | ( | const XPAddress & | addr | ) |
Makes the socket listen on a certain address
| addr | the address to listen on for incoming connections |
| XPSocket * Accept | ( | void | ) |
| int SetSendBuffer | ( | const int | size | ) |
Sets the size of the send buffer for the socket
| size | The size to set the send buffer to or -1 to only return the value |
| int SetRecvBuffer | ( | const int | size | ) |
Sets the size of the recv buffer for the socket
| size | The size to set the recv buffer to or -1 to only return the value |
| int GetAddress | ( | XPAddress *const | addr | ) |
Fills in the internet address and port of the socket to the address structure.
| addr | the address structure to fill in |
| int GetPeerAddress | ( | XPAddress *const | addr | ) |
Fills in the internet address of the peer of the socket to the address structure.
| addr | the address structure to fill in |
| static int GetMaxPacketSize | ( | void | ) | [inline, static] |
Returns the maximum size for a packet
Reimplemented in XPSocketUrgent, and XPStream.
| int MutateSocket | ( | XPSocket * | socket | ) |
Mutates this socket class to use a socket
| socket | the socket to mutate to |
| bool IsAlive | ( | void | ) |
Tests the alive state of the socket
| t_XPSocket * GetSocketPointer | ( | void | ) |
Access for the t_XPSocket pointer
1.5.3