S60 5th Edition SDK Example Applications Guide |
#include <timeserversession.h>
Inheritance diagram for RTimeServerSession:
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 |
|
RTimeServerSession. Constructs the object. Definition at line 34 of file timeserversession.cpp. 00035 : RSessionBase(), iTimeBuffer( NULL, 0, 0 ) 00036 { 00037 // No implementation required 00038 }
|
|
Connect. Connects to the server and create a session.
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 }
|
|
Version. Gets the version number.
Definition at line 63 of file timeserversession.cpp. Referenced by Connect(). 00064 { 00065 return( TVersion( KTimeServMajorVersionNumber, 00066 KTimeServMinorVersionNumber, 00067 KTimeServBuildVersionNumber ) ); 00068 }
|
|
RequestTime. Issues a request for the time to the server.
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 }
|
|
CancelRequestTime. Cancels any outstanding request to the server. Definition at line 94 of file timeserversession.cpp. Referenced by CCSAsyncRequestHandler::DoCancel().
|
|
iTimeBuffer, buffer to write the time to. Definition at line 88 of file timeserversession.h. Referenced by RequestTime(). |
© Nokia 2009 |