sipexsocketreader.h

来自「an example for sip for symbian」· C头文件 代码 · 共 109 行

H
109
字号
/*
* ==============================================================================
*  Name        : SIPExSocketReader.h
*  Part of     : SIPExSocketEngine
*  Interface   : 
*  Description : 
*  Version     : 
*
*  Copyright (c) 2004-2006 Nokia Corporation.
*  This material, including documentation and any related 
*  computer programs, is protected by copyright controlled by 
*  Nokia Corporation.
* ==============================================================================
*/

#ifndef __CSIPEXSOCKETREADER_H__
#define __CSIPEXSOCKETREADER_H__

#include <e32base.h>

// FORWARD DECLARATIONS
class MSIPExReaderNotifier;
class RSocket;

/**
* CSIPExSocketReader
* Reads data from the connected socket.
*/
class CSIPExSocketReader : public CActive
    {
    public:

        /**
        * NewL
        * Static constructor
        * @param aSocket The reference to the socket
        * @param aNotifier The reference to the reader notifier
        */
        static CSIPExSocketReader* NewL( RSocket& aSocket, MSIPExReaderNotifier& aNotifier );

        /**
        * NewLC
        * Static constructor. On return the instance is left to the CleanupStack.
        * @param aSocket The reference to the socket
        * @param aNotifier The reference to the reader notifier
        */
        static CSIPExSocketReader* NewLC( RSocket& aSocket, MSIPExReaderNotifier& aNotifier );

        /**
        * ~CSIPExSocketReader
        * Destructor
        */
        ~CSIPExSocketReader();

    public:

        /**
        * Read
        * Asynchronous function.
        * Starts the asynchronous reading.
        */
        void Read();

    protected: // from CActive

        /**
        * From CActive
        */
        void DoCancel();

        /**
        * From CActive
        */
        void RunL();

    private:
    
        /**
        * CSIPExSocketReader
        * Constructor
        * @param aSocket The reference to the socket
        * @param aNotifier The reference to the reader notifier
        */
        CSIPExSocketReader( RSocket& aSocket, MSIPExReaderNotifier& aNotifier );

        /**
        * ConstructL
        * Symbian 2nd phase constructor that might leave
        */
        void ConstructL();

    private:
        // Member variables

        // Ref: Reader notifier
        MSIPExReaderNotifier&   iNotifier;

        // Ref: Data socket
        RSocket& iSocket;

        // Buffers
        TBuf8<1>    iBuffer;
        TBuf8<256>   iMessage;
    };

#endif // __CSIPEXSOCKETREADER_H__

// end of file

⌨️ 快捷键说明

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