servicediscoveryandcontrol/pnp/test/upnp/SocketHandler/inc/csockethandler.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // @internalTechnology
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __CSOCKETHANDLER_H__
       
    19 #define __CSOCKETHANDLER_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <e32cmn.h>
       
    23 #include <es_mbuf.h>
       
    24 #include <es_sock.h>
       
    25 #include <sockhandlerdefs.h>
       
    26 #include <eintsock.h>
       
    27 
       
    28 // Forward class references.
       
    29 class MSocketHandlerObserver;
       
    30 
       
    31 using namespace SockHandler;
       
    32 /**
       
    33 This is an active object which performs all the asynchronous operations of RInternalSocket. 
       
    34 On completion of the operation CSocketHandler will notify its observer.
       
    35 
       
    36 @internalComponent
       
    37 */
       
    38 class CSocketHandler : public CActive
       
    39 	{
       
    40 	public:
       
    41 		CSocketHandler ( RInternalSocket& aSocket, MSocketHandlerObserver& aObserver );
       
    42 		CSocketHandler ( MSocketHandlerObserver& aObserver );
       
    43 		~CSocketHandler ();
       
    44 		
       
    45 		void Activate ( const TSocketHandlerParams& aParams );
       
    46 		TBool IsRunning ( TOperation aOperation );
       
    47 		
       
    48 	protected:	
       
    49 		// CActive overloads
       
    50 		void RunL ();
       
    51 		void DoCancel ();
       
    52 	
       
    53 	private:
       
    54 		void NotifyCompletion ();
       
    55 		void CancelCurrent ();
       
    56 		void CompleteSelf ( TInt aError );
       
    57 
       
    58 	private:
       
    59 		RInternalSocket				iSocket;
       
    60 		MSocketHandlerObserver&		iObserver;	// Observer for socket operational success completion & error conditons
       
    61 		TOperation					iOperation;
       
    62 		
       
    63 		RMBufChain					iBufChain;
       
    64 		TSockAddr					iSockAddr;
       
    65 		RInternalSocket				iAcceptingSocket;
       
    66 		TSockXfrLength 				iLength;
       
    67 	};
       
    68 
       
    69 #endif // __CSOCKETHANDLER_H__