QuakeForge  0.7.2.210-815cf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

Functions

qboolean Datagram_CanSendMessage (qsocket_t *sock)
 Check if a reliable message can be sent to the socket. More...
 
qboolean Datagram_CanSendUnreliableMessage (qsocket_t *sock)
 Check if an unreliable message can be sent to the socket. More...
 
qsocket_tDatagram_CheckNewConnections (void)
 Check for a new incoming connection. More...
 
void Datagram_Close (qsocket_t *sock)
 Close the socket. More...
 
qsocket_tDatagram_Connect (const char *host)
 Connect to the specified host. More...
 
int Datagram_GetMessage (qsocket_t *sock)
 Check for and process an incoming packet on the socket. More...
 
int Datagram_Init (void)
 Initialize the Datagram net driver. More...
 
void Datagram_Listen (qboolean state)
 Control the listen status of the underlying lan drivers. More...
 
void Datagram_SearchForHosts (qboolean xmit)
 Search for hosts (servers) on the local network. More...
 
int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data)
 Send a reliable packet to the socket. More...
 
int Datagram_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data)
 Send an unreliable packet to the socket. More...
 
void Datagram_Shutdown (void)
 Shutdown the Datagram net driver. More...
 

Detailed Description

Function Documentation

qboolean Datagram_CanSendMessage ( qsocket_t sock)

Check if a reliable message can be sent to the socket.

Parameters
sockThe socket to check.
Returns
True if the packet can be sent.
qboolean Datagram_CanSendUnreliableMessage ( qsocket_t sock)

Check if an unreliable message can be sent to the socket.

Always true.

Parameters
sockThe socket to check.
Returns
True if the packet can be sent.
qsocket_t* Datagram_CheckNewConnections ( void  )

Check for a new incoming connection.

Returns
A pointer to the socekt representing the new connection, or null if none found.
void Datagram_Close ( qsocket_t sock)

Close the socket.

Parameters
sockThe socket to close.
qsocket_t* Datagram_Connect ( const char *  host)

Connect to the specified host.

Parameters
hostThe host to which the connection will be made.
Returns
A pointer to the socket representing the connection, or null if unsuccessful.
int Datagram_GetMessage ( qsocket_t sock)

Check for and process an incoming packet on the socket.

Parameters
sockThe socket to check.
Returns
-1 if there is an error
0 if the packet is stale
1 if the packet is reliable
2 if the packet is unreliable

If there is an outstanding reliable packet and more than 1 second has passed, resend the packet.

Copy unreliable data to net_message

Append reliable data to sock->receiveMessage.

int Datagram_Init ( void  )

Initialize the Datagram net driver.

Also initializes the underlying lan drivers.

Returns
0 if successful, otherwise -1.
void Datagram_Listen ( qboolean  state)

Control the listen status of the underlying lan drivers.

Parameters
stateTrue to enable, false to disable.
void Datagram_SearchForHosts ( qboolean  xmit)

Search for hosts (servers) on the local network.

If xmit is true, broadcast a CCREQ_SERVER_INFO packet via all underlying lan drivers using their control ports.

Check for any CCREP_SERVER_INFO responses. Ignore all other packets.

Parameters
xmitTrue to send the broadcast, falst to only listen.
int Datagram_SendMessage ( qsocket_t sock,
sizebuf_t data 
)

Send a reliable packet to the socket.

Parameters
sockThe socket to which the packet will be sent.
dataThe packet to be sent.
Returns
-1 If there is an error
1 if everything is ok.
int Datagram_SendUnreliableMessage ( qsocket_t sock,
sizebuf_t data 
)

Send an unreliable packet to the socket.

Parameters
sockThe socket to which the packet will be sent.
dataThe packet to be sent.
Returns
-1 If there is an error
1 if everything is ok.
void Datagram_Shutdown ( void  )

Shutdown the Datagram net driver.