RSecureSession Class Reference

List of all members.

Public Member Functions

 RSecureSession ()
TInt Connect ()
TVersion Version () const
TInt ResourceCountL ()
void Close ()

Detailed Description

The client-side handle to a session with the server. The class forms a layer over the Symbian provided RSessionBase class. The main example code calls member functions in the subsession class to make requests to the server. The subsession forwards the requests to the server through the session. A request is identified by a number. This is one of the TSecureServerRequest enum values defined in secureclientandserver.h, The session passes the number and any arguments to the server in a TIpcArgs object.

See also:
RSecureSubSession

Definition at line 47 of file secureclient.h.


Constructor & Destructor Documentation

RSecureSession::RSecureSession (  ) 

Constructor.

Definition at line 42 of file secureclientsession.cpp.


Member Function Documentation

TInt RSecureSession::Connect (  ) 

Connects to the server using 4 message slots. This creates a new session with the server. In this example, the server is implemented as a separate thread. If the server is not running, the function starts the server before it tries to create a session with it. The version information defines the lowest version of the server with which this client is compatible. Version compatibility is checked when the server side session is created. In this example, the version of the server and the version requested by the client are the same. This is because they are defined by constants common to the client source code and the server source code. In a real application, versions would be defined independently.

Returns:
KErrNone, if successful; otherwise, the value returned by StartThread() or CreateSession() if they were unsuccessful.
See also:
StartThread()
CSecureServer::NewSessionL()
RSecureSession::Version()

Definition at line 57 of file secureclientsession.cpp.

TVersion RSecureSession::Version ( void   )  const

Gets the lowest version of the server with which this client is compatible. This is a client-side definition. If the server version is lower than this value, connection fails. In a real application, this is how a client can make sure that the server can provide the services that the client expects. The design of the client-server framework assumes that newer versions of a server are backward compatible with older versions of the server.

Returns:
The version of the server that this client requires.

Definition at line 72 of file secureclientsession.cpp.

TInt RSecureSession::ResourceCountL (  ) 

Gets the resource count from the server. The resource count is the number of subsessions attached to the session.

Returns:
The resource count.

Definition at line 92 of file secureclientsession.cpp.

void RSecureSession::Close (  ) 

Deletes all handles associated with session.

Definition at line 80 of file secureclientsession.cpp.


Generated by  doxygen 1.6.2