S60 5th Edition SDK Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : timeserversession.h 00004 * Part of : CSAsync 00005 * Interface : 00006 * Description : 00007 * Version : 00008 * 00009 * Copyright (c) 2004-2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 00017 #ifndef __TIMESERVERSESSION_H__ 00018 #define __TIMESERVERSESSION_H__ 00019 00020 // INCLUDE FILES 00021 #include <e32base.h> 00022 00023 // CONSTANTS 00024 // Number of message slots to reserve for this client server session. 00025 // In this example we can have one asynchronous request outstanding 00026 // and one synchronous request in progress. 00027 const TUint KDefaultMessageSlots = 2; 00028 00029 const TUid KServerUid3 = { 0xA0000227 }; // Server UID 00030 00031 _LIT( KTimeServerFilename, "CSAsyncServer" ); 00032 00033 #ifdef __WINS__ 00034 static const TUint KServerMinHeapSize = 0x1000; // 4K 00035 static const TUint KServerMaxHeapSize = 0x10000; // 64K 00036 #endif 00037 00038 // CLASS DECLARATION 00039 /** 00040 * RTimeServerSession 00041 * This class provides the client-side interface to the server session 00042 */ 00043 class RTimeServerSession : public RSessionBase 00044 { 00045 public: // Constructors and destructors 00046 00047 /** 00048 * RTimeServerSession. 00049 * Constructs the object. 00050 */ 00051 RTimeServerSession(); 00052 00053 public: // New functions 00054 00055 /** 00056 * Connect. 00057 * Connects to the server and create a session. 00058 * @return Error code. 00059 */ 00060 TInt Connect(); 00061 00062 /** 00063 * Version. 00064 * Gets the version number. 00065 * @return The version. 00066 */ 00067 TVersion Version() const; 00068 00069 /** 00070 * RequestTime. 00071 * Issues a request for the time to the server. 00072 * @param aTime The location for the server to write data into. 00073 * @param aStatus The TRequestStatus object to be used for async comms. 00074 */ 00075 void RequestTime( TTime& aTime,TRequestStatus& aStatus ); 00076 00077 /** 00078 * CancelRequestTime. 00079 * Cancels any outstanding request to the server. 00080 */ 00081 void CancelRequestTime() const; 00082 00083 private: // Data 00084 00085 /** 00086 * iTimeBuffer, buffer to write the time to. 00087 */ 00088 TPtr8 iTimeBuffer; 00089 }; 00090 00091 00092 #endif // __TIMESERVERSESSION_H__ 00093 00094 00095 // End of File
© Nokia 2009 |