gt2Send

GameSpy SDK

gt2Send

Sends data over a connection, reliably or unreliably.

void gt2Send(
GT2Connection connection,
const GT2Byte * message,
int len,
GT2Bool reliable );
RoutineRequired HeaderDistribution
gt2Send<gt2.h>SDKZIP

Parameters

connection
[in] The handle to the connection.
message
[in] The message to send. Can be NULL.
len
[in] The length of the message. Can be 0. A len of -1 is equivalent to (strlen(message) + 1).
reliable
[in] if GT2True, send the message reliably, otherwise send it unreliably.

Remarks

Once a connection has been established, messages can be sent back and forth on it. To send a message, use the gt2Send function. If message is NULL or len is 0, then an empty message will be sent. When an empty message is received, message will be NULL and len will be 0. If the message is sent reliably, it is guaranteed to arrive, arrive only once, and arrive in order (relative to other reliable messages). If the message is sent unreliably, then it is not guaranteed to arrive, and if it does arrive, it is not guaranteed to arrive in order, or only once. Note that the 7 byte header must be accounted for in the message if the function sends the message reliably.

Section Reference: Gamespy Transport SDK

See Also: gt2ReceivedCallback