commsfwsupport/commselements/StartServer/include/CA_StartServer.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2003-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 // THIS API IS INTERNAL TO NETWORKING AND IS SUBJECT TO CHANGE AND NOT FOR EXTERNAL USE
       
    15 // CStartServer Client side header
       
    16 // Declares an active object to wait for asynchronously started server process,
       
    17 // perhaps even repeat the session creation attempts
       
    18 // 
       
    19 //
       
    20 
       
    21 /**
       
    22  @file 
       
    23  @internalTechnology
       
    24 */
       
    25 
       
    26 #ifndef __CA_STARTSERVER_H__
       
    27 #define __CA_STARTSERVER_H__
       
    28 
       
    29 #include <comms-infras/startprocess.h>
       
    30 
       
    31 class RAsyncConnectBase;
       
    32 /**
       
    33  Starts a server process and asynchronously and synchronise with it. 
       
    34  
       
    35  The process must support synchronisation via Randezvous
       
    36  @see RStartServer
       
    37  @internalTechnology
       
    38 **/
       
    39 class CStartServer : public CActive
       
    40 	{
       
    41 public:
       
    42    	IMPORT_C CStartServer(RAsyncConnectBase& aAsyncConnectBase, const TVersion& aVersion, TInt aAsyncMessageSlots);
       
    43    	IMPORT_C ~CStartServer();
       
    44    	IMPORT_C void Connect(const TDesC& aServerName, TRequestStatus& aStatus, TUint aAttempts = 3);
       
    45    	IMPORT_C void Cancel();
       
    46 
       
    47 protected:
       
    48    	virtual void DoCancel();
       
    49    	virtual void RunL();
       
    50    	void Connect(const TDesC& aServerName);
       
    51 
       
    52 protected:
       
    53    	RAsyncConnectBase& iAsyncConnectBase;
       
    54    	const TVersion& iVersion;
       
    55    	TInt iAsyncMessageSlots;
       
    56    	/**
       
    57      iStartProcess - RStartProcess to asynchronously start server
       
    58      @internalTechnology
       
    59    	**/
       
    60    	RStartProcess iStartProcess;
       
    61    	TUint iAttempts;
       
    62    	TRequestStatus* iClientStatus;
       
    63    	/**
       
    64      iCounter - counts the attempts to start the daemon
       
    65      @internalTechnology
       
    66    	**/
       
    67    	TUint iCounter;
       
    68       TInt iProcessStarting;
       
    69    	TBufC<KMaxFileNameLength> iName;
       
    70 };
       
    71 
       
    72 #endif
       
    73