bluetoothcommsprofiles/btpan/bnep/CSocketWriter.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2004-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef __CSOCKETWRITER_H
       
    22 #define __CSOCKETWRITER_H 
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32std.h>
       
    26 #include <e32def.h>
       
    27 #include <es_mbuf.h>
       
    28 #include <comms-infras/eintsock.h>
       
    29 
       
    30 class CBnepLink;
       
    31 
       
    32 
       
    33 const TUint8 KMaxSocketWriterQueueSize = 5;
       
    34 
       
    35 /**
       
    36    @file
       
    37    @internalComponent
       
    38    Active object to handle socket writes.
       
    39 */
       
    40 NONSHARABLE_CLASS(CSocketWriter) : public CActive  
       
    41     {
       
    42 
       
    43 public:
       
    44     ~CSocketWriter();
       
    45     static CSocketWriter* NewL (RInternalSocket& aSocket, CBnepLink& aOwner);
       
    46     TInt Write (RMBufChain& aChain);
       
    47 
       
    48 private:
       
    49     CSocketWriter (RInternalSocket& aSocket, CBnepLink& aOwner);
       
    50     void ConstructL ();
       
    51     void RunL ();
       
    52     void DoCancel ();
       
    53 
       
    54 private: 
       
    55 
       
    56     RInternalSocket& iSocket;
       
    57    	CBnepLink& iBnepLink;
       
    58 	RMBufPktQ iQueue;
       
    59     TUint8 iQueueSize;
       
    60     RMBufChain iPendingWriteData;
       
    61     };
       
    62 #endif