S60 5th Edition SDK Example Applications Guide |
#include <timeserversession.h>
Inheritance diagram for RTimeServerSession:
Definition at line 44 of file timeserversession.h.
Public Member Functions | |
RTimeServerSession () | |
TInt | Connect () |
TVersion | Version () const |
void | RequestTime (TTime &aTime) const |
|
RTimeServerSession. Constructs the object. Definition at line 33 of file timeserversession.cpp.
|
|
Connect. Connects to the server and create a session.
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 }
|
|
Version. Gets the version number.
Definition at line 62 of file timeserversession.cpp. Referenced by Connect(). 00063 { 00064 return( TVersion( KTimeServMajorVersionNumber, 00065 KTimeServMinorVersionNumber, 00066 KTimeServBuildVersionNumber ) ); 00067 }
|
|
RequestTime. Issues a request for the time to the server.
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 }
|
© Nokia 2009 |