ReplicaNet and RNLobby
1
|
#include <XPSocketUrgentClass.h>
Public Member Functions | |
int | Create (const int port=XPSOCK_PORT_ANY) |
int | Create (const XPAddress &addr) |
int | MakeBroadcast (void) |
int | Send (const char *data, const XPAddress &addr) |
int | Send (const char *data, const int len, const XPAddress &addr) |
int | Recv (char *const data, const int maxlen, XPAddress *const addr) |
![]() | |
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 | GetMaxPacketSize (void) |
![]() | |
static int | GetLastError (void) |
static int | GetMaxPacketSize (void) |
An extension to the normal XPSocket class that handles urgent but unreliable packets. This call also makes use of the function in the XPSocket base class Most member functions return an XPSOCK_EERROR code. XPSOCK_EOK indicates no error. XPSOCK_EWOULDBLOCK is a non-fatal error and means the socket operation would have blocked the current thread at this point. If XPSOCK_EERROR is returned the user should use XPSocket::GetLastError() to find out the actual error code
int Create | ( | const int | port = XPSOCK_PORT_ANY | ) |
Creates an urgent socket. Communication through this socket is faster but less reliable. A mechanism is supplied to enable data to be sent in a reliable manner but at the expense of CPU time and network bandwidth Returns XPSOCK_EERROR if an error occurred If port is zero (0) or XPSOCK_PORT_ANY then the network layer will pick a port number to be bound to Using a value of zero for the port when operating a client is advised since the any chosen port might already be in use
References XPSock_UrgentCreate().
int Create | ( | const XPAddress & | addr | ) |
Creates an urgent socket bound to a specific address. Please see Create(const int port) for more information.
References XPSock_UrgentCreate().
|
inlinestatic |
Returns the maximum size for a packet
int MakeBroadcast | ( | void | ) |
Makes an urgent socket broadcast capable
References XPSock_UrgentMakeBroadcast().
int Recv | ( | char *const | data, |
const int | maxlen, | ||
XPAddress *const | addr | ||
) |
Receives data from an urgent socket
data | pointer to a data buffer |
maximum | length of the data buffer |
addr | the address of the sending socket for any data received |
References XPSock_UrgentRecv().
int Send | ( | const char * | data, |
const XPAddress & | addr | ||
) |
Sends a NULL terminated string to the peer (the connected machine) for this socket
data | The pointer to the NULL terminated string |
References XPSock_UrgentSend().
int Send | ( | const char * | data, |
const int | len, | ||
const XPAddress & | addr | ||
) |
Send an urgent packet from the socket to the specified address. The data sent is not guaranteed to arrive at the destination. This will return XPSOCK_EUDPSENDFAILED if this method doesn't exist. If so use a non-urgent socket
data | the pointer to the data to send |
len | the length of the data to send |
the | address and port number to send to |
References XPSock_UrgentSend().