rtp/rtpstack/inc/rtpcommrecv.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004-2005 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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef RtpCommRecv_H
       
    22 #define RtpCommRecv_H
       
    23 
       
    24 #include <rtpdef.h>
       
    25 #include "rtpcommdef.h"
       
    26 #include "rtputil.h"
       
    27 
       
    28 /**
       
    29 *  Class definition for receiving
       
    30 *
       
    31 *  @lib RtpService.dll
       
    32 */
       
    33 class CRtpCommRecv : public CActive
       
    34     {
       
    35     #if defined( _DEBUG ) && defined( RTP_UNIT_TEST )
       
    36     // Friend class used for testing
       
    37         friend class CRtpUtRtpCommRecv;
       
    38         friend class CRtpUtRtpComm;
       
    39     #endif 
       
    40     public:
       
    41         static CRtpCommRecv* NewL( TPortType aPortType, RSocket& aSocket, 
       
    42                                    TInt aPriority, MRtpErrNotify& aErrNotify,
       
    43                                    TBool aNonRtpObserverSet ); 
       
    44 
       
    45         ~CRtpCommRecv();
       
    46         void RegisterReceivedNotify( MReceivedNotify* aNotify );
       
    47         TInt Recv( TDes8& aPacket );
       
    48         void SetRemoteAddress(TInetAddr& aAddr);     
       
    49         void SetNonRtpObserverFlag(TBool aValue);      
       
    50         TBool IsSetRemoteAdress();     
       
    51 
       
    52     public: // from CActive
       
    53         void RunL();
       
    54         void DoCancel();
       
    55 
       
    56     private:
       
    57         CRtpCommRecv( TPortType aPortType, RSocket& aSocket, 
       
    58                       TInt aPriority, MRtpErrNotify& aErrNotify,
       
    59                       TBool aNonRtpObserverSet );
       
    60         void ConstructL();
       
    61 
       
    62     private:
       
    63         TPortType iPortType;
       
    64         MReceivedNotify* iRecvNotify;
       
    65         RSocket& iSocket;
       
    66         TInetAddr iFromAddr;
       
    67         TInetAddr iRemoteAddr;
       
    68         TBool iRemoteAddrSet;        
       
    69         MRtpErrNotify&  iRtpErrNotify; 
       
    70         TBool iNonRtpObserverSet;        
       
    71 	 
       
    72 	 private:
       
    73 	 #ifdef EUNIT_TESTING
       
    74 	  friend class UT_CRtpComm;
       
    75 	  friend class UT_CRtpCommRecv;
       
    76 	  friend class UT_CRtpSession;
       
    77 	#endif     	    
       
    78     };
       
    79 #endif	// RtpCommRecv_H