S60 3rd Edition SDK for Symbian OS
Example Applications Guide

SIPExSocketWriter.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : SIPExSocketWriter.h
00004 *  Part of     : SIPExSocketEngine
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 #ifndef __CSIPEXSOCKETWRITER_H__
00017 #define __CSIPEXSOCKETWRITER_H__
00018 
00019 #include <e32base.h>
00020 
00021 // FORWARD DECLARATIONS
00022 class MSIPExWriterNotifier;
00023 class RSocket;
00024 
00025 /**
00026 * CSIPExSocketWriter
00027 * Writes data to the connected socket.
00028 */
00029 class CSIPExSocketWriter : public CActive
00030     {
00031     public:
00032 
00033         /**
00034         * NewL
00035         * Static constructor
00036         * @param aSocket The reference to the socket
00037         * @param aNotifier The reference to the writer notifier
00038         */
00039         static CSIPExSocketWriter* NewL( RSocket& aSocket, MSIPExWriterNotifier& aNotifier );
00040 
00041         /**
00042         * NewLC
00043         * Static constructor. On return the instance is left to the CleanupStack.
00044         * @param aSocket The reference to the socket
00045         * @param aNotifier The reference to the writer notifier
00046         */
00047         static CSIPExSocketWriter* NewLC( RSocket& aSocket, MSIPExWriterNotifier& aNotifier );
00048 
00049         /**
00050         * ~CSIPExSocketWriter
00051         * Destructor
00052         */
00053         ~CSIPExSocketWriter();
00054 
00055     public:
00056  
00057         /**
00058         * Write
00059         * Asynchronous function.
00060         * Starts the asynchronous writing.
00061         */
00062         void Write( const TDesC8& aBuffer );
00063 
00064     protected: // from CActive
00065 
00066         /**
00067         * From CActive
00068         */
00069         void DoCancel();
00070 
00071         /**
00072         * From CActive
00073         */
00074         void RunL();
00075 
00076     private:
00077     
00078         /**
00079         * CSIPExSocketWriter
00080         * Constructor
00081         * @param aSocket The reference to the socket
00082         * @param aNotifier The reference to the writer notifier
00083         */
00084         CSIPExSocketWriter( RSocket& aSocket, MSIPExWriterNotifier& aNotifier );
00085 
00086         /**
00087         * ConstructL
00088         * Symbian 2nd phase constructor that might leave
00089         */
00090         void ConstructL();
00091 
00092     private:
00093         // Member variables
00094         MSIPExWriterNotifier&   iNotifier;
00095 
00096         // Ref: Data socket
00097         RSocket&    iSocket;
00098 
00099         // The write buffer
00100         HBufC8*     iBuffer;
00101     };
00102 
00103 #endif // __CSOCKETWRITER_H__
00104 
00105 // End of file

© Nokia 2006

Back to top