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

📄 fileserver.h

📁 Symbian Client_Server_Application
💻 H
字号:
/*
* ==============================================================================
*  Name        : FileServer.h
*  Part of     :clientserversync
*  Interface   : 
*  Description : 
*  Version     : 
* ==============================================================================
*/


#ifndef __FileSERVER_H__
#define __FileSERVER_H__

// INCLUDE FILES
#include <e32base.h>
#include "SyncServer.pan"

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

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

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

    public: // New functions

        /**
        * ThreadFunction.
        * Main function for the server thread.
        * @param aNone Not used.
        * @return Error code.
        */
        static TInt ThreadFunction( TAny* aNone );

        /**
        * 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();

    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

        /**
        * CFileServer.
        * C++ default constructor.
        * @param aPriority priority for this thread.
        */
        CFileServer( 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,
                                 TFileServPanic aReason );

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

        /**
        * ThreadFunctionL.
        * Second stage startup for the server thread.
        */
        static void ThreadFunctionL();

    private: // Functions from base classes

        /**
        * From CServer, NewSessionL.
        * Create a File 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 // __FileSERVER_H__


// End of File

⌨️ 快捷键说明

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