natplugins/natptraversalcontroller/inc/cnatbindingstunandcrlfrefresher.h
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CNATBINDINGSTUNANDCRLFREFRESHER_H
       
    19 #define CNATBINDINGSTUNANDCRLFREFRESHER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include "cnatbindingstunrefresher.h"
       
    23 #include "mnatbindingrefresherobserver.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CUdpCRLFSender;
       
    27 class MNATTraversalSocketManager;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 /**
       
    31 * A class for STUN based NAT binding refresh.
       
    32 */
       
    33 class CNATBindingSTUNAndCRLFRefresher : public CNATBindingSTUNRefresher,
       
    34                                         public MNATBindingRefresherObserver
       
    35     {
       
    36     public:  // Constructors and destructor
       
    37 
       
    38         static CNATBindingSTUNAndCRLFRefresher* NewL(
       
    39             CDeltaTimer& aDeltaTimer,
       
    40             TInt aRefreshInterval,
       
    41             MNATBindingRefresherObserver& aObserver,
       
    42             CNATBinding& aNATBinding,
       
    43             RSocket& aSocket,
       
    44             const TInetAddr& aAddr,
       
    45             MNATTraversalSocketManager& aSocketManager );
       
    46 
       
    47         static CNATBindingSTUNAndCRLFRefresher* NewLC(
       
    48             CDeltaTimer& aDeltaTimer,
       
    49             TInt aRefreshInterval,
       
    50             MNATBindingRefresherObserver& aObserver,
       
    51             CNATBinding& aNATBinding,
       
    52             RSocket& aSocket,
       
    53             const TInetAddr& aAddr,
       
    54             MNATTraversalSocketManager& aSocketManager );
       
    55 
       
    56         ~CNATBindingSTUNAndCRLFRefresher();
       
    57 
       
    58     public: // From MNATBindingRefresherObserver
       
    59 
       
    60         void NATBindingRefreshComplete( TInt aCompletionCode );
       
    61 
       
    62     protected: // From CNATBindingRefresher
       
    63 
       
    64         void RefreshTimerExpiredL();
       
    65 
       
    66         void CancelRefresh();
       
    67 
       
    68     private: // Constructors
       
    69 
       
    70         CNATBindingSTUNAndCRLFRefresher(
       
    71             CDeltaTimer& aDeltaTimer,
       
    72             TInt aRefreshInterval,
       
    73             MNATBindingRefresherObserver& aObserver,
       
    74             CNATBinding& aNATBinding );
       
    75 
       
    76          void ConstructL(
       
    77             RSocket& aSocket,
       
    78             const TInetAddr& aAddr,
       
    79             MNATTraversalSocketManager& aSocketManager );
       
    80 
       
    81     private: // Data
       
    82 
       
    83         CUdpCRLFSender* iCRLFSender;
       
    84     };
       
    85 
       
    86 #endif // CNATBINDINGSTUNANDCRLFREFRESHER_H
       
    87 
       
    88 // End of File