⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tmserver.h

📁 c++下s60终端对终端传输协议
💻 H
字号:
/* Copyright (c) 2005, Forum Nokia. All rights reserved */


#ifndef __TMSERVER_H__
#define __TMSERVER_H__

// INCLUDE FILES
#include <e32base.h>

_LIT( KTMExampleServer, "TMExampleServer" );

/** SyncServer panic codes */
enum TTmServPanic
    {
    EBadRequest,
    EBadDescriptor,
    ESrvCreateServer,
    ECreateTrapCleanup,
    };

// CLASS DECLARATION
/**
* CTmServer.
*  An instance of class CTmServer is the main server class
*  for the example application
*/
class CTmServer : public CServer2
    {
    public : // Constructors and destructors

        /**
        * NewL.
        * Two-phased constructor.
        * @return Pointer to created CTmServer object.
        */
        static CTmServer* NewL();

        /**
        * NewLC.
        * Two-phased constructor.
        * @return Pointer to created CTmServer object.
        */
        static CTmServer* NewLC();

    public: // New functions

        /**
        * IncrementSessions.
        * Increments the count of the active sessions for this server.
        */
        void IncrementSessions();

        /**
        * DecrementSessions.
        * Decrements the count of the active sessions for this server.
        * If no more sessions are in use the server terminates.
        */
        void DecrementSessions();
        
        static TInt RunServer();
        static void RunServerL();

    protected: // Functions from base classes

        /**
        * From CActive, RunError.
        * Processes any errors.
        * @param aError The leave code reported.
        * @result return KErrNone if leave is handled.
        */
        TInt RunError( TInt aError );

    private: // Constructors and destructors

        /**
        * CTmServer.
        * C++ default constructor.
        * @param aPriority priority for this thread.
        */
        CTmServer( TInt aPriority );

        /**
        * ConstructL.
        * 2nd phase constructor.
        */
        void ConstructL();

    private: // New methods

        /**
        * PanicClient.
        * Panics the client.
        * @param aMessage The message channel to the client.
        * @param aReason The reason code for the panic.
        */
        static void PanicClient( const RMessage2& aMessage,
                                 TTmServPanic aReason );

        /**
        * PanicServer.
        * Panics the server.
        * @param aReason the reason code for the panic.
        */
        static void PanicServer( TTmServPanic aReason );

    private: // Functions from base classes

        /**
        * From CServer, NewSessionL.
        * Create a tm server session.
        * @param aVersion The client version.
        * @return Pointer to new session.
        */
        CSession2* NewSessionL( const TVersion& aVersion, 
            const RMessage2& aMessage ) const;
        

    private: // Data

        /**
        * iSessionCount, the number of open sessions.
        */
        TInt iSessionCount;
    };


#endif // __TMSERVER_H__


// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -