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.

RSubSessionBase – client-side sub-session<br />

RSubSessionBase is the base class for a client-side subsession. Here are the relevant<br />

parts of its declaration:<br />

class RSubSessionBase<br />

{<br />

public:<br />

inline TInt SubSessionHandle() const;<br />

protected:<br />

inline RSubSessionBase();<br />

inline RSessionBase& Session();<br />

...<br />

IMPORT_C TInt CreateSubSession(<br />

RSessionBase& aSession,<br />

TInt aFunction,<br />

const TAny* aPtr);<br />

IMPORT_C void CloseSubSession(TInt aFunction);<br />

...<br />

IMPORT_C TInt Send(TInt aFunction,const TAny* aPtr) const;<br />

IMPORT_C void SendReceive(<br />

TInt aFunction,<br />

const TAny* aPtr,<br />

TRequestStatus& aStatus) const;<br />

IMPORT_C TInt SendReceive(TInt aFunction,const TAny* aPtr)<br />

const;<br />

...<br />

};<br />

An RSubSession object is created by calling CreateSubSession()with references to an<br />

existing RSessionBase object and a function to perform. Once the subsession has been<br />

created, the normal SendReceive() and Send() functions can be used to communicate<br />

with the server. When the subsession has been finished with, the CloseSubSession()<br />

function should be called. If access to the RSessionBase object is required, then the<br />

Session() function can be used.<br />

18.4.4 Server-side Objects<br />

The three main server-side objects are CServer, the base class for the entire server,<br />

CSharableSession, the base class for a server-side object, and RMessage, which<br />

contains the message sent from a client.<br />

There is just one CServer object per server, but there are as many<br />

CSession/CSharableSession objects as there are RSessionBase objects currently in<br />

session with this server. There is one server-side RMessage object for each outstanding

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

Saved successfully!

Ooh no, something went wrong!