realtimenetprots/rtp/cfrtp/src/cfrtphandler.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2007-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 // CCFRtp Handler Implementation
       
    15 // 
       
    16 //
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "cfrtphandler.h"
       
    26 
       
    27 CCFRtpHandler* CCFRtpHandler::NewL(MRtpDataSender *aDataSender, TInt aPriority)
       
    28 	{	
       
    29 	CCFRtpHandler* self = new(ELeave) CCFRtpHandler(aPriority);
       
    30 	self->iDataSender = aDataSender;
       
    31 	return self;
       
    32 	}
       
    33 
       
    34 CCFRtpHandler::CCFRtpHandler(TInt aPriority) 
       
    35 : CRtpHandlerBase(aPriority)
       
    36 	{
       
    37 	}
       
    38 
       
    39 CCFRtpHandler::~CCFRtpHandler()
       
    40 	{
       
    41 	}
       
    42 
       
    43 void CCFRtpHandler::Send(TDes8& aBuffer, TRequestStatus& aStatus)
       
    44 	{	
       
    45 	/* Pass it on to our Data sender. The "Normal" handlers will send this to 
       
    46 	 * iRtpSocket */
       
    47 	iDataSender->SendData(aBuffer, iRemoteAddr, 0, aStatus);
       
    48 	}
       
    49 
       
    50 // this could only be a genuine read from client
       
    51 void CCFRtpHandler::Read(TDes8& )
       
    52 	{	
       
    53     //Read?. This is not expected in the case of CF Rtp Handlers */
       
    54 	ASSERT(0);
       
    55 	}
       
    56 
       
    57 void CCFRtpHandler::ReadMore()
       
    58 	{
       
    59     //We are anyways reading always! 
       
    60 	}
       
    61 
       
    62 void CCFRtpHandler::RunL()
       
    63 	{
       
    64 	/* We should never have an Active Request pending */
       
    65 	ASSERT(0);
       
    66 	}
       
    67 
       
    68 TInt CCFRtpHandler::RunError(TInt)
       
    69 	{
       
    70 	/* We cannot hit RunL() so cannot hit here as well */
       
    71 	ASSERT(0);
       
    72 	return KErrNone;
       
    73 	}
       
    74 
       
    75 void CCFRtpHandler::ActivateL(RSocketServ& ,TRtpConnectionType ,RSubConnection& )
       
    76 	{	
       
    77 	User::LeaveIfError(KErrNotSupported);
       
    78 	}
       
    79 
       
    80 
       
    81 void CCFRtpHandler::ActivateL(RSocketServ& ,TRtpConnectionType , RConnection& )
       
    82 	{	
       
    83 	User::LeaveIfError(KErrNotSupported);
       
    84 	}
       
    85 
       
    86 
       
    87 
       
    88 void CCFRtpHandler::ActivateL(RSocketServ& ,TRtpConnectionType )
       
    89 	{	
       
    90 	User::LeaveIfError(KErrNotSupported);
       
    91 	}
       
    92 
       
    93 
       
    94 /**
       
    95 Compare two addreesses of KAfInet family type
       
    96 @internalComponent
       
    97 @return 
       
    98 @param 
       
    99 @param 
       
   100 @pre 
       
   101 @post 
       
   102 */
       
   103 TBool CCFRtpHandler::CompareAddresses(const TSockAddr& aAddr1,const TSockAddr& aAddr2)
       
   104 	{
       
   105 	if(aAddr1.Family() != aAddr2.Family())
       
   106 		{
       
   107 		return EFalse;
       
   108 		}
       
   109 	TInetAddr inetAddr1(aAddr1);
       
   110 	TInetAddr inetAddr2(aAddr2);
       
   111 	//Tests the protocol family, IP address, and port values
       
   112 	return inetAddr1.CmpAddr(inetAddr2);
       
   113 	}
       
   114 
       
   115 void CCFRtpHandler::CancelSend()
       
   116 	{
       
   117 	/* The request is already completed */
       
   118 	return;
       
   119 	}
       
   120 
       
   121 void CCFRtpHandler::CancelRecv()
       
   122 	{
       
   123 	/* No read .. So no cancel for read */
       
   124 	return;
       
   125 	}