natfw/natfwconnectionmultiplexer/src/cncmudpreceiver.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:    UDP receiver
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #include "cncmudpreceiver.h"
       
    22 #include "ncmconnectionmultiplexerlogs.h"
       
    23 
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // CNcmUdpReceiver::CNcmUdpReceiver
       
    27 // ---------------------------------------------------------------------------
       
    28 //
       
    29 CNcmUdpReceiver::CNcmUdpReceiver( RSocket& aSocket,
       
    30     MNcmReceiverSenderObserver& aObserver ) :
       
    31     CNcmReceiver( aSocket, aObserver )
       
    32     {
       
    33     }
       
    34 
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // CNcmUdpReceiver::NewL
       
    38 // ---------------------------------------------------------------------------
       
    39 //
       
    40 CNcmUdpReceiver* CNcmUdpReceiver::NewL( RSocket& aSocket,
       
    41     MNcmReceiverSenderObserver& aObserver )
       
    42     {
       
    43     __CONNECTIONMULTIPLEXER( "CNcmUdpReceiver::NewL" )
       
    44         
       
    45     CNcmUdpReceiver* self = CNcmUdpReceiver::NewLC( aSocket, aObserver );
       
    46     CleanupStack::Pop( self );
       
    47     return self;
       
    48     }
       
    49 
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // CNcmUdpReceiver::NewLC
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 CNcmUdpReceiver* CNcmUdpReceiver::NewLC( RSocket& aSocket,
       
    56     MNcmReceiverSenderObserver& aObserver )
       
    57     {
       
    58     __CONNECTIONMULTIPLEXER( "CNcmUdpReceiver::NewLC" )
       
    59         
       
    60     CNcmUdpReceiver* self = new( ELeave ) CNcmUdpReceiver(
       
    61             aSocket, aObserver );
       
    62             
       
    63     CleanupStack::PushL( self );
       
    64     return self;
       
    65     }
       
    66 
       
    67     
       
    68 // ---------------------------------------------------------------------------
       
    69 // CNcmUdpReceiver::~CNcmUdpReceiver
       
    70 // ---------------------------------------------------------------------------
       
    71 //
       
    72 CNcmUdpReceiver::~CNcmUdpReceiver()
       
    73     {
       
    74     __CONNECTIONMULTIPLEXER( "CNcmUdpReceiver::~CNcmUdpReceiver" )
       
    75     }
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // From class CNcmReceiver
       
    79 //
       
    80 // CNcmUdpReceiver::DoReceive
       
    81 // ---------------------------------------------------------------------------
       
    82 //
       
    83 void CNcmUdpReceiver::DoReceive()
       
    84     {
       
    85     __CONNECTIONMULTIPLEXER( "CNcmUdpReceiver::DoReceive" )
       
    86     
       
    87     if ( !IsActive() )
       
    88         {
       
    89         iSocket.RecvFrom( iBuffer, iFromAddr, 0, iStatus );
       
    90         SetActive(); 
       
    91         }  
       
    92     }