03.01.2013 Views

Chapter 1

Chapter 1

Chapter 1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Overview<br />

In the previous two chapters, I've described the Symbian OS active object and client-server<br />

frameworks – the foundations for system programming. I'm now in a position to describe the<br />

Game Session Datagram Protocol (GSDP) server we implemented for sharing GDP<br />

datagrams among multiple client games on a single Symbian OS phone. Along the way, we<br />

will encounter all the most important practical techniques needed to program a Symbian OS<br />

server.<br />

We've already seen that the purpose of the GSDP server is to allow GDP drivers to be<br />

shared between multiple games on a single Symbian OS phone. To achieve this, the GSDP<br />

server:<br />

� runs the GDP implementations on behalf of all games on a Symbian OS phone;<br />

� associates an origin address, a destination address, a destination port number, and a<br />

game protocol with each client session so that from the client's perspective, GSDP is a<br />

session protocol rather than a stateless datagram protocol;<br />

� when sending a packet selects the right GDP implementation and adds the correct port<br />

numbers and game protocol ID into the packet's datagram content;<br />

� when receiving a packet uses the port number and protocol ID to select the client that<br />

should receive it.<br />

This functionality is reflected in both the server's client interface and in its internal structure.<br />

The GSDP server presented here has its own specific task to perform, but in many ways it's<br />

typical, and I'll describe it in sufficient detail here so that you can use it with confidence as a<br />

basis for implementing your own servers.<br />

<strong>Chapter</strong> 19: The GSDP Server<br />

Overview<br />

In the previous two chapters, I've described the Symbian OS active object and client-server<br />

frameworks – the foundations for system programming. I'm now in a position to describe the<br />

Game Session Datagram Protocol (GSDP) server we implemented for sharing GDP<br />

datagrams among multiple client games on a single Symbian OS phone. Along the way, we<br />

will encounter all the most important practical techniques needed to program a Symbian OS<br />

server.<br />

We've already seen that the purpose of the GSDP server is to allow GDP drivers to be<br />

shared between multiple games on a single Symbian OS phone. To achieve this, the GSDP<br />

server:<br />

� runs the GDP implementations on behalf of all games on a Symbian OS phone;<br />

� associates an origin address, a destination address, a destination port number, and a<br />

game protocol with each client session so that from the client's perspective, GSDP is a<br />

session protocol rather than a stateless datagram protocol;<br />

� when sending a packet selects the right GDP implementation and adds the correct port<br />

numbers and game protocol ID into the packet's datagram content;<br />

� when receiving a packet uses the port number and protocol ID to select the client that<br />

should receive it.<br />

This functionality is reflected in both the server's client interface and in its internal structure.

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

Saved successfully!

Ooh no, something went wrong!