NNBeginNegotiationWithSocket

GameSpy SDK

NNBeginNegotiationWithSocket

Starts the negotiation process using the socket provided, which will be shared with the game.

NegotiateError NNBeginNegotiationWithSocket(
SOCKET gamesocket,
int cookie,
int clientindex,
NegotiateProgressFunc progresscallback,
NegotiateCompletedFunc completedcallback,
void * userdata );
RoutineRequired HeaderDistribution
NNBeginNegotiationWithSocket<natneg.h>SDKZIP

Return Value

Possible errors that can be returned when starting a negotiation
ne_noerror: No error
ne_allocerror: Memory allocation failed
ne_socketerror: Socket allocation failed
ne_dnserror: DNS lookup failed

Parameters

gamesocket
[in] The socket to be used to start the negotiation
cookie
[in] Shared cookie value that both players will use so that the NAT Negotiation Server can match them up.
clientindex
[in] One client must use clientindex 0, the other must use clientindex 1.
progresscallback
[in] Callback function that will be called as the state changes.
completedcallback
[in] Callback function that will be called when negotiation is complete.
userdata
[in] Pointer for your own use that will be passed into the callback functions.

Remarks

Incoming traffic is not processed automatically - you will need to read the data off the socket and pass NN packets to NNProcessData.

Section Reference: Gamespy NAT Negotiation SDK

See Also: NNBeginNegotiation