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 44 of file timeserversession.h.

Public Member Functions

 RTimeServerSession ()
TInt Connect ()
TVersion Version () const
void RequestTime (TTime &aTime) const


Constructor & Destructor Documentation

RTimeServerSession::RTimeServerSession  ) 
 

RTimeServerSession. Constructs the object.

Definition at line 33 of file timeserversession.cpp.

00034 : RSessionBase()
00035     {
00036     // No implementation required
00037     }


Member Function Documentation

TInt RTimeServerSession::Connect  ) 
 

Connect. Connects to the server and create a session.

Returns:
Error code.

Definition at line 44 of file timeserversession.cpp.

References Version().

Referenced by CCSSyncDocument::ConstructL().

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

TVersion RTimeServerSession::Version  )  const
 

Version. Gets the version number.

Returns:
The version.

Definition at line 62 of file timeserversession.cpp.

Referenced by Connect().

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

void RTimeServerSession::RequestTime TTime &  aTime  )  const
 

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

Parameters:
aTime The location for the server to write data into.

Definition at line 74 of file timeserversession.cpp.

Referenced by CCSSyncDocument::UpdateTime().

00075     {
00076     // Create descriptor to enable copying data between client and server.
00077     // Note: This can be local since this is a synchronous call.
00078     // Note : Using TPtr8 since this is binary information.
00079     TPtr8 descriptor( reinterpret_cast<TUint8*>( &aTime ), sizeof( aTime ),
00080                       sizeof( aTime ) );
00081     
00082     // Package message arguments before sending to the server
00083     TIpcArgs args( &descriptor );
00084         
00085     // This call waits for the server to complete the request before
00086     // proceeding. When it returns, the new time will be in aTime.
00087     SendReceive( ETimeServRequestTime, args );
00088     }


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

© Nokia 2009

Back to top