Symbian3/PDK/Source/GUID-B12A3024-44BF-51FF-9B84-14DB99ADC907.dita
changeset 1 25a17d01db0c
child 3 46218c8b8afa
equal deleted inserted replaced
0:89d6a7a84779 1:25a17d01db0c
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept xml:lang="en" id="GUID-B12A3024-44BF-51FF-9B84-14DB99ADC907"><title>Using a Service by the Client</title><prolog><metadata><keywords/></metadata></prolog><conbody><section><title>Procedure</title> <p>A client must perform the following steps to use a service implemented over the server application framework: </p> <ol id="GUID-2DE908C7-D123-5991-AD78-BB3DCDCF20D5"><li id="GUID-23FABF3E-2223-5273-8085-8B58C1D454EA"><p>Identify the service support provided for the service in the platform. </p> </li> <li id="GUID-85E440C9-545B-542E-AAA3-DA96671D8355"><p>Include the client-support header of the service support and link to the service support DLL. </p> </li> <li id="GUID-038B9CE4-0667-5E00-9738-868621B467B6"><p>Use the service's implementation discovery support to find an implementation to connect to. </p> </li> <li id="GUID-8FB1C15B-FB86-5BD4-9ACA-F1F2DEB1B5D1"><p>Create a new instance of the client-side service, connecting it to a new or existing service application instance as necessary. </p> </li> <li id="GUID-B4F341FE-DACC-5154-88DB-6C6C24531434"><p>Monitor the lifetime of the server application, so that appropriate cleanup can be performed on server application exit. </p> </li> <li id="GUID-F935C6AA-CF07-58C5-BF33-77F7A630C718"><p>Use the server application. </p> </li> </ol> </section> <example><title>Using a chat service example</title> <p>The following is an example of a chat service. </p> <codeblock id="GUID-37841491-CE8B-57F9-870B-261DA7001B03" xml:space="preserve">void CMyApp::HandleCommandL(aCommand)
       
    13
       
    14     case EMyAppCmdStart:
       
    15         iChatter = new(ELeave) CChatter(this);
       
    16         iChatter-&gt;ConstructL(TUid::Uid(0x0de630f1));
       
    17         iServerMonitor = CApaServerAppExitMonitor::NewL(iChatter-&gt;iSub, this);
       
    18     break; 
       
    19 
       
    20     case EMyAppCmdSend:
       
    21         if (iChatter)
       
    22             iChatter-&gt;SendL(_L("hello server"));
       
    23     break;</codeblock> </example> </conbody><related-links><link href="GUID-2AE2256B-A749-5634-80FE-EC4BDABB28C9.dita"><linktext>Server
       
    24                 Applications</linktext> </link> </related-links></concept>