vpnengine/ikesocket/inc/receiver.h
changeset 19 c29f8e059978
parent 0 33413c0669b9
equal deleted inserted replaced
17:8962128a2656 19:c29f8e059978
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    66  *  Received data will be ignored, if data does not correspond to specified
    66  *  Received data will be ignored, if data does not correspond to specified
    67  *  IKE major version.
    67  *  IKE major version.
    68  *  
    68  *  
    69  *  @lib ikesocket.lib
    69  *  @lib ikesocket.lib
    70  */
    70  */
    71 NONSHARABLE_CLASS( CReceiver ) : private CActive
    71 NONSHARABLE_CLASS( CReceiver ) : private CTimer
    72     {
    72     {
    73 public:
    73 public:
    74     /**
    74     /**
    75      * Two-phased constructor.
    75      * Two-phased constructor.
    76      * @param aSocket Socket which is used for receiving
    76      * @param aSocket Socket which is used for receiving
   111     
   111     
   112 private:
   112 private:
   113 
   113 
   114     enum TReceiverState
   114     enum TReceiverState
   115         {
   115         {
   116         EIdle,          // Idle
   116         EIdle,                   // Idle
   117         EWaitingData,   // Waiting data to become available for reading
   117         EWaitingData,            // Waiting data to become available for reading
   118         EReceiving      // Receiving data
   118         EReceiving,              // Receiving data
       
   119         EWaitingAfterSocketError // Waiting after socket error 
   119         };    
   120         };    
   120 
   121 
   121     CReceiver( RSocket& aSocket,
   122     CReceiver( RSocket& aSocket,
   122                MReceiverCallback& aCallback,
   123                MReceiverCallback& aCallback,
   123                MIkeDebug& aDebug );
   124                MIkeDebug& aDebug );
   139      */
   140      */
   140     void HandleDataReceivedL();
   141     void HandleDataReceivedL();
   141     
   142     
   142     /**
   143     /**
   143      * Handles error in receiving.
   144      * Handles error in receiving.
   144      */
   145      * @param aStatus Error status
   145     void HandleError( const TInt aStatus );
   146      * @param aSocket Informs if delay needed
       
   147      */
       
   148     void HandleError( const TInt aStatus,
       
   149                       const TBool aDelayNeeded = EFalse );
   146     
   150     
   147     /**
   151     /**
   148      * Notifies client that data has been received.
   152      * Notifies client that data has been received.
   149      */    
   153      */    
   150     void NotifyDataReceived();
   154     void NotifyDataReceived();
   178     /**
   182     /**
   179      * Receiver state.
   183      * Receiver state.
   180      * Own.
   184      * Own.
   181      */
   185      */
   182     TReceiverState      iState;
   186     TReceiverState      iState;
   183         
   187        
       
   188     /**
       
   189      * Maximum error count.
       
   190      * Own.
       
   191      */
       
   192     TInt                iErrorCount;
       
   193     
   184     /**
   194     /**
   185      * Message data.
   195      * Message data.
   186      * Own.
   196      * Own.
   187      */
   197      */
   188     HBufC8*             iMsg;
   198     HBufC8*             iMsg;