realtimenetprots/sipfw/SIP/ConnectionMgr/inc/CReceiverTcp.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Name          : CReceiverTcp.h
       
    16 * Part of       : ConnectionMgr
       
    17 * Version       : SIP/4.0 
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 #ifndef CRECEIVERTCP_H
       
    29 #define CRECEIVERTCP_H
       
    30 
       
    31 #include <e32base.h>
       
    32 #include <in_sock.h>
       
    33 #include "MSIPMsgAssemblerOwner.h"
       
    34 
       
    35 class MContext;
       
    36 class CSIPMsgAssembler;
       
    37 
       
    38 
       
    39 class CReceiverTcp : public CActive, public MSIPMsgAssemblerOwner
       
    40 	{
       
    41 	
       
    42 public:
       
    43 
       
    44     enum TState
       
    45         {
       
    46         EIdle,
       
    47         EConnecting,
       
    48         EConnected,
       
    49         EShuttingDown
       
    50         };
       
    51         
       
    52 public:
       
    53 
       
    54 	static CReceiverTcp* NewL(MContext& aContext);
       
    55 	static CReceiverTcp* NewLC(MContext& aContext);
       
    56 	
       
    57 	~CReceiverTcp();
       
    58 	
       
    59 public: // From CActive
       
    60 
       
    61 	void RunL();
       
    62 	void DoCancel();
       
    63 	TInt RunError(TInt aError);
       
    64 
       
    65 public: // From MSIPMsgAssemblerOwner
       
    66 
       
    67     void MessageCompleteL(CSIPMessage* aSIPMessage,
       
    68 						  TInt aError,
       
    69 						  TBool aCompressed);
       
    70 						  
       
    71 public:
       
    72 
       
    73 	void ReceiveDataL();
       
    74 	void Connect(TInetAddr& aRemoteAddr);
       
    75     void Shutdown();
       
    76 	
       
    77 	TInetAddr iAddr;	
       
    78 	
       
    79 private:
       
    80 
       
    81 	void ConstructL();
       
    82 	CReceiverTcp(MContext& aContext);
       
    83 
       
    84 private:
       
    85 
       
    86 	void RemoveReceived();
       
    87 	
       
    88 private: // Data
       
    89 
       
    90 	MContext& iContext;
       
    91 	TPtr8 iReceivedMsgPtr;
       
    92 	
       
    93 	HBufC8* iReceivedMsg;	
       
    94 	
       
    95 	TState iReceiverState;
       
    96 	TSockXfrLength iSockLenght;
       
    97 	TUint iNextLength;
       
    98 	CSIPMsgAssembler* iMsgAssembler;
       
    99 	
       
   100 	};
       
   101 #endif // end of CRECEIVERTCP_H
       
   102 
       
   103 // End of File