03.01.2013 Views

Chapter 1

Chapter 1

Chapter 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Function Description<br />

ConnectL() Connects to the GSDP server and specifies a GSDP packet<br />

handler. The server is launched if it is not already active.<br />

Close() Closes the session with the server. The server may choose<br />

to terminate if it has no more clients, but the client API does<br />

not mandate this.<br />

GetGdpProtocolInfo() Together with CountGdpProtocols(), can be used to<br />

enumerate the installed GDP protocols at run time.<br />

SetGdpProtocol() Sets the GDP implementation to be used by the session.<br />

Will return an error if the implementation is not available, or<br />

cannot be initialized.<br />

GdpIsNetworked() Indicates whether the GDP implementation is networked<br />

(requires valid addresses) or point-to-point (ignores<br />

addresses).<br />

SetGameProtocol() Sets the game protocol, specifying a 32-bit UID.<br />

SetMyPort() Sets my port ID, specifying the port ID as a 32-bit unsigned<br />

value. Use this function when restoring a session previously<br />

established.<br />

AllocMyNextPort() Allocates a unique port ID for me, and returns its value. Use<br />

this function when starting a new session.<br />

SetOtherAddress() Sets the address of the other partner in the communication,<br />

with a string.Used only by networked GDP<br />

implementations.<br />

SetOtherPort() Sets the port of the other partner in the communication,<br />

with a 32-bit unsigned value. Use this when setting up a<br />

session that has been previously established; set it to zero<br />

when starting a new session.<br />

Listen() Causes a Receive() request to be issued. When the<br />

request completes, the received datagram will be handled<br />

using MGsdpPacketHandler::GsdpHandleL(). The<br />

receive request will then be renewed so that without client<br />

intervention any number of packets can be received.<br />

StopListening() Cancels any outstanding receive request started by<br />

Listen(). You may issue this function even if no call to<br />

Listen() has been issued or if it has already been<br />

canceled.<br />

Send() Sends a datagram using whatever current address, port,<br />

GDP implementation, and game protocol ID are specified.<br />

ReceiveAll() Causes the GDP implementation to do a ReceiveAll().<br />

This may result in received packets that need to be handled<br />

for any GSDP session that uses the same GDP<br />

implementation, not only the GSDP session that issued the<br />

ReceiveAll().<br />

GetXxx() Getter functions for address, port, GDP implementation,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!