Symbian3/PDK/Source/GUID-B12A3024-44BF-51FF-9B84-14DB99ADC907.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 02 Jul 2010 12:51:36 +0100
changeset 11 5072524fcc79
parent 5 f345bda72bc4
child 14 578be2adaf3e
permissions -rw-r--r--
Fixing terminology

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<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)

    case EMyAppCmdStart:
        iChatter = new(ELeave) CChatter(this);
        iChatter-&gt;ConstructL(TUid::Uid(0x0de630f1));
        iServerMonitor = CApaServerAppExitMonitor::NewL(iChatter-&gt;iSub, this);
    break; 

    case EMyAppCmdSend:
        if (iChatter)
            iChatter-&gt;SendL(_L("hello server"));
    break;</codeblock> </example> </conbody><related-links><link href="GUID-2AE2256B-A749-5634-80FE-EC4BDABB28C9.dita"><linktext>Server
                Applications</linktext> </link> </related-links></concept>