Nuclide
Software Development Kit for id Tech
tcp.qc File Reference

Functions

int TCP_Connect (tcpinfo_t *in, string path)
 Open a TCP socket connection. More...
 
void TCP_Disconnect (tcpinfo_t *in)
 Closes a TCP socket connection. More...
 
int TCP_Send (tcpinfo_t *in, string msg)
 Send a string buffer to a specified TCP connection. More...
 
string TCP_Receive (tcpinfo_t *in)
 Receive the latest message from a TCP connection. More...
 
void TCP_Frame (tcpinfo_t *in)
 You want to run this every frame. More...
 
tcpstate_t TCP_GetState (tcpinfo_t *in)
 Returns the tcpstate_t of a connection. More...
 

Function Documentation

◆ TCP_Connect()

int TCP_Connect ( tcpinfo_t in,
string  path 
)

Open a TCP socket connection.

Parameters
inPointer to a tcpinfo_t struct to save state into.
pathThe address:port to which we should connect to.
Returns
The descriptor for the newly opened socket. Will be below 0 if invalid.

◆ TCP_Disconnect()

void TCP_Disconnect ( tcpinfo_t in)

Closes a TCP socket connection.

@parm in Pointer to a tcpinfo_t that is to be closed.

◆ TCP_Frame()

void TCP_Frame ( tcpinfo_t in)

You want to run this every frame.

Parameters
inPointer to an active TCP connection.

◆ TCP_GetState()

tcpstate_t TCP_GetState ( tcpinfo_t in)

Returns the tcpstate_t of a connection.

Parameters
inPointer to an active TCP connection.

◆ TCP_Receive()

string TCP_Receive ( tcpinfo_t in)

Receive the latest message from a TCP connection.

Parameters
inPointer to an active TCP connection.

◆ TCP_Send()

int TCP_Send ( tcpinfo_t in,
string  msg 
)

Send a string buffer to a specified TCP connection.

Parameters
inPointer to an active TCP connection.
msgThe message to send to the TCP connection.