Symbian3/SDK/Source/GUID-50BE8F1A-513A-433C-B045-66658FC226D7.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     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 id="GUID-50BE8F1A-513A-433C-B045-66658FC226D7" xml:lang="en"><title>Client/server
       
    13 communication</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p><xref href="GUID-E530CBB9-C20D-5426-89AA-DC0281C05381.dita">Inter Process
       
    15 Communication</xref> (IPC) is the basis for client/server architecture. Clients
       
    16 and servers run in different threads, although not necessarily in different
       
    17 processes, and communicate through message passing protocol. There are no
       
    18 direct pointers between the parties, leaving the integrity of the server and
       
    19 its resources untouched by clients. For more information, see <xref href="GUID-D4C7A714-F7BB-5A8D-A875-4796395B9B6C.dita">Introduction
       
    20 to the client/server architecture</xref>.</p>
       
    21 <p>Communication between the client and the server is managed by <xref href="GUID-E651C7A7-D6EB-533E-A97A-360D089DE7A5.dita">Inter-thread data transfer</xref>.
       
    22 Only the server and its clients can decode the parameters of the message.
       
    23 This is also a security feature, because process boundaries are separators
       
    24 of memory space, direct pointers to the client's data structures cannot be
       
    25 delivered. All data not fitting in the provided integers must be represented
       
    26 as a <xref href="GUID-261ADCEC-C8C8-46E3-A7DC-804AC868C233.dita">descriptor</xref>,
       
    27 and an address to the descriptor (or actually a <codeph><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Kernel_Architecture_2/TPckgClass.html" format="application/java-archive">TPckg</xref></codeph> object)
       
    28 is delivered within the message. The server then uses safe inter-thread read
       
    29 and write functions to access the provided descriptor.</p>
       
    30 <p>The following figure shows the relationship of the <codeph><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Kernel_Architecture_2/e32cmn.hGlobals.html#%3a%3aTDesC" format="application/java-archive">TDesC</xref></codeph> and <codeph><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Kernel_Architecture_2/TPckgClass.html" format="application/java-archive">TPckg</xref></codeph> classes.</p>
       
    31 <fig id="GUID-715F1B96-AFC4-4FB2-AF51-6E720077F83A"><title>Relationship of a message package and a descriptor class</title><image href="GUID-D99BA4CA-9823-4968-953D-36AA7F266B39_d0e10779_href.png"/></fig>
       
    32 <p>Consider the following issues when implementing the client-side API:</p>
       
    33 <ul>
       
    34 <li><p>Determine if the server is already running with the <codeph><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Kernel_Architecture_2/TFindServerClass.html" format="application/java-archive">TFindServer</xref></codeph> class. If not, then it should be launched.</p></li>
       
    35 <li><p>Once the server is running, create the connection with <codeph><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Kernel_Architecture_2/RSessionBaseClass.html" format="application/java-archive">RSessionBase::CreateSession</xref></codeph> and make sure there are free message slots available to avoid lost
       
    36 messages.</p></li>
       
    37 <li><p>When packaging message arguments, make sure they are in a
       
    38 format that the server understands. For more information, see <codeph><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/Kernel_Architecture_2/TIpcArgsClass.html" format="application/java-archive">TIpcArgs</xref></codeph>.</p></li>
       
    39 </ul>
       
    40 </conbody></concept>