javacommons/comms/ipclib/clientserver/src.s60/ipcclient.h
changeset 21 2a9601315dfc
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     1 /*
       
     2 * Copyright (c) 2008 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: IpcClient is the client side implementation
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef IPCCLIENT_H
       
    19 #define IPCCLIENT_H
       
    20 #include "scopedlocks.h"
       
    21 
       
    22 #include "transport.h"
       
    23 #include "rcomms.h"
       
    24 
       
    25 namespace java
       
    26 {
       
    27 namespace comms
       
    28 {
       
    29 class CReceiver;
       
    30 
       
    31 NONSHARABLE_CLASS(IpcClient) : public CActive, public IpcConnectionInterface
       
    32 {
       
    33 public:
       
    34     IpcClient(IpcListener* aListener);
       
    35     ~IpcClient();
       
    36 
       
    37     // IpcConnectionInterface methods
       
    38     virtual int connect(int aAddr);
       
    39     virtual void disconnect();
       
    40     virtual int send(ipcMessage_t* aMsg);
       
    41 
       
    42     virtual void error(TInt aError);
       
    43 
       
    44 private:
       
    45     virtual void RunL();
       
    46     virtual void DoCancel();
       
    47     virtual TInt RunError(TInt aError);
       
    48 
       
    49     static void messageLoop(TAny* aArgs);
       
    50     void doMainL();
       
    51 
       
    52     int         mAddress;
       
    53     RThread     mThread;
       
    54     bool        mRunning;
       
    55     RComms      mComms;
       
    56     CReceiver*  mReceiver;
       
    57 
       
    58     java::util::ScopedMutex mMutex;
       
    59     IpcListener* mListener;
       
    60 };
       
    61 
       
    62 } // namespace comms
       
    63 } // namespace java
       
    64 
       
    65 #endif // IPCCLIENT_H