diff -r 000000000000 -r f5a58ecadc66 servicediscoveryandcontrol/pnp/test/upnp/SocketHandler/inc/csockethandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/servicediscoveryandcontrol/pnp/test/upnp/SocketHandler/inc/csockethandler.h Tue Feb 02 01:12:20 2010 +0200 @@ -0,0 +1,69 @@ +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// @internalTechnology +// +// + +#ifndef __CSOCKETHANDLER_H__ +#define __CSOCKETHANDLER_H__ + +#include +#include +#include +#include +#include +#include + +// Forward class references. +class MSocketHandlerObserver; + +using namespace SockHandler; +/** +This is an active object which performs all the asynchronous operations of RInternalSocket. +On completion of the operation CSocketHandler will notify its observer. + +@internalComponent +*/ +class CSocketHandler : public CActive + { + public: + CSocketHandler ( RInternalSocket& aSocket, MSocketHandlerObserver& aObserver ); + CSocketHandler ( MSocketHandlerObserver& aObserver ); + ~CSocketHandler (); + + void Activate ( const TSocketHandlerParams& aParams ); + TBool IsRunning ( TOperation aOperation ); + + protected: + // CActive overloads + void RunL (); + void DoCancel (); + + private: + void NotifyCompletion (); + void CancelCurrent (); + void CompleteSelf ( TInt aError ); + + private: + RInternalSocket iSocket; + MSocketHandlerObserver& iObserver; // Observer for socket operational success completion & error conditons + TOperation iOperation; + + RMBufChain iBufChain; + TSockAddr iSockAddr; + RInternalSocket iAcceptingSocket; + TSockXfrLength iLength; + }; + +#endif // __CSOCKETHANDLER_H__