gt2Accept

GameSpy SDK

gt2Accept

Accepts an incoming connection attempt.

GT2Bool gt2Accept(
GT2Connection connection,
GT2ConnectionCallbacks * callbacks );
RoutineRequired HeaderDistribution
gt2Accept<gt2.h>SDKZIP

Return Value

GT2False means the connection was closed between when the gt2ConnectAttemptCallback was called and this function was called. The connection cannot be used.

Parameters

connection
[in] The handle to the connection.
callbacks
[in] The set of callbacks associated with the connection.

Remarks

After a socket's gt2ConnectAttemptCallback has been called, this function can be used to accept the incoming connection attempt. It can be called from either within the callback or some later time. As soon as it is called the connection is active, and messages can be sent and received. The remote side of the connection will have it's connected callback called with the result set to GT2Success. The callbacks that are passed in to this function are the same callbacks that get passed to gt2Connect, with the exception that the connected callback can be ignored, as the connection is already established. If this function returns GT2True, then the connection has been successfully accepted. If it returns GT2False, then the remote side has already closed the connection attempt. In that case, the connection is considered closed, and it cannot be referenced again.