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.

Appendix 3: TOGS Guide and Reference<br />

Overview<br />

In this appendix, I describe the main constituents of TOGS – Transaction Oriented Games<br />

Stack:<br />

� GDP, providing unreliable datagram service<br />

� GSDP, adding sessions<br />

� RGCP, adding reliability and request/response conversation support<br />

� BSP, implementing the processing for Battleships.<br />

I'll describe each of these protocols in the following way:<br />

� Introduce it and say why it's there<br />

� Describe the protocol in the abstract<br />

� Outline the Symbian OS implementation<br />

� Point out what future development is needed on this protocol.<br />

GDP<br />

GDP is the Game Datagram Protocol. Its purpose is to provide the simplest possible<br />

interface for sending and receiving packets of data. As a client, you call a SendL() function,<br />

specifying a to-address and some data – a datagram (see Figure A3.1). A GDP<br />

implementation transfers this packet to the target address, where software executes a<br />

GdpHandleL()function whose parameters include the from-address and the data.<br />

Figure A3.1<br />

The address received by GdpHandleL() should be such that it can be used to generate a<br />

reply to the sender.<br />

The address format is defined by the GDP implementation. A networked GDP<br />

implementation requires addresses. A point-to-point GDP implementation doesn't require<br />

addresses: it relies on physical connectivity to get a datagram to the other endpoint. Both the<br />

SMS and Bluetooth protocols are address-based. Clearly, loopback is a point-to- point<br />

protocol.<br />

GDP is not limited in its application to Symbian OS machines – a GDP implementation may<br />

communicate with machines running other operating systems as well. For this reason, a<br />

concrete GDP implementation should specify its physical data formats with sufficient<br />

precision for another system to be able to implement a corresponding GDP stack that<br />

connects to it.<br />

GDP is unreliable. That means a request through SendL() is sent on a best-efforts basis,<br />

but it's not guaranteed to arrive precisely once – it may never arrive, or it may (in rare<br />

circumstances) arrive more than once. GDP is not responsible for taking recovery action or<br />

for returning error codes for these events to its clients. However, GDP should make<br />

reasonable efforts and it should be possible for the end user to understand its reason for

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

Saved successfully!

Ooh no, something went wrong!