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

Functions

const char * NET_AdrToString (netadr_t a)
 Convert an address to a string. More...
 
const char * NET_BaseAdrToString (netadr_t a)
 Convert an address to a string. More...
 
qboolean NET_CompareAdr (netadr_t a, netadr_t b)
 Compare two network addresses. More...
 
qboolean NET_CompareBaseAdr (netadr_t a, netadr_t b)
 Compare two network addresses. More...
 
qboolean NET_GetPacket (void)
 Read a single packet from the network into net_message. More...
 
void NET_Init (int port)
 Initialize the UDP network interface. More...
 
void NET_SendPacket (int length, const void *data, netadr_t to)
 Send a data packet out to the network. More...
 
void NET_Shutdown (void)
 Shutdown the UDP network interface. More...
 
qboolean NET_StringToAdr (const char *s, netadr_t *a)
 Convert a human readable address to a quake address. More...
 

Detailed Description

Function Documentation

const char* NET_AdrToString ( netadr_t  a)

Convert an address to a string.

Include the port number in the string.

Warning
The return value is a pointer to a static buffer. The returned string must be saved if mixing calls with different addresses.
Parameters
aThe address to convert
Returns
The address in human readable form.
const char* NET_BaseAdrToString ( netadr_t  a)

Convert an address to a string.

Do not include the port number in the string.

Warning
The return value is a pointer to a static buffer. The returned string must be saved if mixing calls with different addresses.
Parameters
aThe address to convert
Returns
The address in human readable form.
qboolean NET_CompareAdr ( netadr_t  a,
netadr_t  b 
)

Compare two network addresses.

Compare the port number too.

Parameters
aThe first address to compare.
bThe second address to compare.
Returns
True of the addresses match, otherwise false.
qboolean NET_CompareBaseAdr ( netadr_t  a,
netadr_t  b 
)

Compare two network addresses.

Ignore the port number.

Parameters
aThe first address to compare.
bThe second address to compare.
Returns
True of the addresses match, otherwise false.
qboolean NET_GetPacket ( void  )

Read a single packet from the network into net_message.

Returns
True if successfully read, otherwise false.
void NET_Init ( int  port)

Initialize the UDP network interface.

Opens a single socket to be used for all communications.

Parameters
portThe port to which the socket will be bound.
void NET_SendPacket ( int  length,
const void *  data,
netadr_t  to 
)

Send a data packet out to the network.

Parameters
lengthThe length of the data to be sent.
dataThe data to be sent.
toThe address to which the data will be sent.
void NET_Shutdown ( void  )

Shutdown the UDP network interface.

qboolean NET_StringToAdr ( const char *  s,
netadr_t a 
)

Convert a human readable address to a quake address.

Accepts both host names (full or partial) and numeric form.

If a port is specified, the port value in the address will be set to that value, otherwise it will be set to 0.

Parameters
[in]sThe human readable address to be converted.
[out]aThe resulting address of the conversion.
Returns
True if the conversion is successful, otherwise false.