gt2Reject

GameSpy SDK

gt2Reject

Rejects a connection attempt.

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

Parameters

connection
[in] The handle to the connection.
message
[in] Rejection message. May be NULL.
len
[in] Length of the rejection message. May be 0. A len of –1 is equivalent to (strlen(message) + 1).

Remarks

After a socket's gt2ConnectAttemptCallback has been called, this function can be used to reject the incoming connection attempt. It can be called from either within the callback or some later time. Once the function is called the connection is considered closed and cannot be referenced again. The remote side attempting the connection will have its connected callback called with the result set to gt2Rejected. If the message is not NULL and the len is not 0, the message will be sent with the rejection, and passed into the remote side's connected callback. Note that the 7 byte header must be accounted for in the message since this function will send the rejection message reliably.