?? tmsession.h
字號:
/* Copyright (c) 2005, Forum Nokia. All rights reserved */
#ifndef __TMSESSION_H__
#define __TMSESSION_H__
// INCLUDE FILES
#include <e32base.h>
#include <f32file.h>
#include "TmServer.h"
#include "ClientServerCommon.h"
// FORWARD DECLARATIONS
class CTmServer;
/**
* The filenames used in this example
*/
_LIT(KAddressFileName, "address.dat");
_LIT(KPortFileName, "port.dat");
_LIT(KTypeFileName, "type.dat");
// CLASS DECLARATION
/**
* CTmServerSession.
* An instance of class CTmServerSession is created for each client.
*/
class CTmServerSession : public CSession2 // CSession
{
public: // Constructors and destructors
/**
* NewL.
* Two-phased constructor.
* @param aClient The Client's thread.
* @param aServer The server.
* @return Pointer to created CTmServerSession object.
*/
static CTmServerSession* NewL( CTmServer& aServer );
/**
* NewLC.
* Two-phased constructor.
* @param aClient The Client's thread.
* @param aServer The server.
* @return Pointer to created CTmServerSession object.
*/
static CTmServerSession* NewLC( CTmServer& aServer );
/**
* ~CTmServerSession.
* Destructor.
*/
virtual ~CTmServerSession();
public: // Functions from base classes
/**
* From CSession, ServiceL.
* Service request from client.
* @param aMessage Message from client
* (containing requested operation and any data).
*/
void ServiceL( const RMessage2& aMessage );
private: // Constructors and destructors
/**
* CTmServerSession.
* C++ default constructor.
* @param aClient The Client's thread.
* @param aServer The server.
*/
CTmServerSession( CTmServer& aServer );
/**
* ConstructL.
* 2nd phase constructor.
*/
void ConstructL();
private: // New methods
/**
* PanicClient.
* Causes the client thread to panic.
* @param aPanic Panic code.
*/
void PanicClient( TInt aPanic ) const;
/**
* SetAddressL.
* Saves the remote server address given by the client of this session.
*/
void SetAddressL();
/**
* RequestAddressL.
* Writes the remote server address that was set using SetAddressL back
* to the client.
*/
void RequestAddressL();
/**
* SetPortL.
* Saves the remote server port given by the client of this session.
*/
void SetPortL();
/**
* RequestPortL.
* Writes the remote server port that was set using SetPortL back to the
* client.
*/
void RequestPortL();
/**
* SetTypeL.
* Saves the remote server type given by the client of this session.
*/
void SetTypeL();
/**
* RequestTypeL.
* Writes the remote server type that was set using SetTypeL back to the
* client.
*/
void RequestTypeL();
/**
* RequestAllL.
* Writes the remote server address, port and type that wer set
* using (one or more of) the setter methods back to the client.
*/
void RequestAllL();
/**
* SetAllL.
* Saves the remote server addres, port and type given by the client
* of this session.
*/
void SetAllL();
/**
* Two utility methods for writing and reading the encrypted files.
*/
void WriteFileL( TInt aMsgIndex, const TDesC& aFileName );
void ReadFileL( TInt aMsgIndex, const TDesC& aFileName );
private: // Data
/**
* iServer, reference to the server.
*/
CTmServer& iServer;
/**
* iFs, reference to the file server used by this session
*/
RFs iFs;
/**
* iClientMsg, reference to the message received from the client
*/
RMessage2 iClientMsg;
};
#endif // __TMSESSION_H__
// End of File
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -