S60 5th Edition SDK
Example Applications Guide

RTimeServerSession Class Reference

#include <timeserversession.h>

Inheritance diagram for RTimeServerSession:

List of all members.

Detailed Description

RTimeServerSession This class provides the client-side interface to the server session

Definition at line 43 of file timeserversession.h.

Public Member Functions

 RTimeServerSession ()
TInt Connect ()
TVersion Version () const
void RequestTime (TTime &aTime, TRequestStatus &aStatus)
void CancelRequestTime () const

Private Attributes

TPtr8 iTimeBuffer


Constructor & Destructor Documentation

RTimeServerSession::RTimeServerSession  ) 
 

RTimeServerSession. Constructs the object.

Definition at line 34 of file timeserversession.cpp.

00035 : RSessionBase(), iTimeBuffer( NULL, 0, 0 )
00036     {
00037     // No implementation required
00038     }


Member Function Documentation

TInt RTimeServerSession::Connect  ) 
 

Connect. Connects to the server and create a session.

Returns:
Error code.

Definition at line 45 of file timeserversession.cpp.

References Version().

Referenced by CCSAsyncRequestHandler::ConstructL().

00046     {
00047     TInt error = ::StartServer();
00048 
00049     if ( KErrNone == error )
00050         {
00051         error = CreateSession( KTimeServerName,
00052                                Version(),
00053                                KDefaultMessageSlots );
00054         }
00055     return error;
00056     }

TVersion RTimeServerSession::Version  )  const
 

Version. Gets the version number.

Returns:
The version.

Definition at line 63 of file timeserversession.cpp.

Referenced by Connect().

00064     {
00065     return( TVersion( KTimeServMajorVersionNumber,
00066                       KTimeServMinorVersionNumber,
00067                       KTimeServBuildVersionNumber ) );
00068     }

void RTimeServerSession::RequestTime TTime &  aTime,
TRequestStatus &  aStatus
 

RequestTime. Issues a request for the time to the server.

Parameters:
aTime The location for the server to write data into.
aStatus The TRequestStatus object to be used for async comms.

Definition at line 75 of file timeserversession.cpp.

References iTimeBuffer.

Referenced by CCSAsyncRequestHandler::RequestTime().

00076     {
00077     iTimeBuffer.Set( reinterpret_cast<TUint8*>( &aTime ), sizeof( aTime ),
00078                      sizeof( aTime ) );
00079     
00080     // Package message arguments before sending to the server
00081     TIpcArgs args( &iTimeBuffer );
00082     
00083     // This call completes immediately, however the server will not
00084     // complete the request until later, so don't pass any local
00085     // descriptors as they will be out of scope by the time the server
00086     // attempts to write to them
00087     SendReceive( ETimeServRequestTime, args, aStatus );
00088     }

void RTimeServerSession::CancelRequestTime  )  const
 

CancelRequestTime. Cancels any outstanding request to the server.

Definition at line 94 of file timeserversession.cpp.

Referenced by CCSAsyncRequestHandler::DoCancel().

00095     {
00096     SendReceive( ETimeServCancelRequestTime, TIpcArgs(NULL) );
00097     }


Member Data Documentation

TPtr8 RTimeServerSession::iTimeBuffer [private]
 

iTimeBuffer, buffer to write the time to.

Definition at line 88 of file timeserversession.h.

Referenced by RequestTime().


The documentation for this class was generated from the following files:

© Nokia 2009

Back to top