PECengine/PresenceServer2/ClientSrc/RPEngManagerClient.cpp
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Presence server main client
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //  INCLUDES
       
    20 #include <f32file.h>
       
    21 
       
    22 #include "RPEngManagerClient.h"
       
    23 
       
    24 #include "PEngServerStarter.h"
       
    25 #include "TPEngServerCommon.h"
       
    26 
       
    27 
       
    28 // PEC Engine internal constants
       
    29 #include "PEngInternalGlobalConsts.h"
       
    30 
       
    31 // debug prints
       
    32 #include "PresenceDebugPrint.h"
       
    33 
       
    34 // CONSTANTS
       
    35 
       
    36 /*
       
    37  * Number of message slots we allocated to this client.
       
    38  * There can be several Transaction and Session holder clients
       
    39  * per several sessions -> 50
       
    40  */
       
    41 const TUint KMessageSlotCount = 50;
       
    42 
       
    43 
       
    44 // MACROS
       
    45 #define RETURN_IF_NOT_CONNECTED()\
       
    46     if(!iConnected)\
       
    47         {\
       
    48         return KErrDisconnected;\
       
    49         }
       
    50 
       
    51 
       
    52 // ============== NEW EXPORTED FUNCTIONS OF THE CLIENT====================
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // RPEngManagerClient::RPEngManagerClient
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 EXPORT_C RPEngManagerClient::RPEngManagerClient()
       
    59     {
       
    60     }
       
    61 
       
    62 // Destructor
       
    63 EXPORT_C RPEngManagerClient::~RPEngManagerClient()
       
    64     {
       
    65     }
       
    66 
       
    67 // ============================ EXPORTED FUNCTIONS ===============================
       
    68 
       
    69 // RPEngManagerClient::Connect
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 EXPORT_C TInt RPEngManagerClient::Connect()
       
    73     {
       
    74     PENG_DP_TXT( "RPEngManagerClient::Connect()" );
       
    75 
       
    76     TInt err = PEngServerStarter::ConnectServer( *this,
       
    77                                                  KServerName,
       
    78                                                  Version(),
       
    79                                                  KMessageSlotCount,
       
    80                                                  KServerExe );
       
    81 
       
    82     iConnected = ( err == KErrNone );
       
    83     return err;
       
    84     }
       
    85 
       
    86 // -----------------------------------------------------------------------------
       
    87 // RPEngManagerClient::Close
       
    88 // -----------------------------------------------------------------------------
       
    89 //
       
    90 EXPORT_C void RPEngManagerClient::Close( void )
       
    91     {
       
    92     PENG_DP( D_PENG_LIT( "RPEngManagerClient::Close()" ) );
       
    93 
       
    94     // all requests from this session are canceled on the server side
       
    95     RSessionBase::Close();
       
    96     iConnected = EFalse;
       
    97 
       
    98 
       
    99 #if _BullseyeCoverage
       
   100     cov_write();
       
   101 #endif
       
   102     }
       
   103 
       
   104 
       
   105 // ======================= OTHER NOT-EXPORTED FUNCTIONS ========================
       
   106 
       
   107 // -----------------------------------------------------------------------------
       
   108 // RPEngManagerClient::Version
       
   109 // Return version of the client
       
   110 // (other items were commented in a header).
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 TVersion RPEngManagerClient::Version() const
       
   114     {
       
   115     return( TVersion( KClientVersionMajor, KClientVersionMinor, KClientVersionBuild ) );
       
   116     }
       
   117 
       
   118 
       
   119 //  End of File