Symbian3/SDK/Source/GUID-50BE8F1A-513A-433C-B045-66658FC226D7.dita
changeset 13 48780e181b38
parent 8 ae94777fff8f
equal deleted inserted replaced
12:80ef3a206772 13:48780e181b38
     7     Nokia Corporation - initial contribution.
     7     Nokia Corporation - initial contribution.
     8 Contributors: 
     8 Contributors: 
     9 -->
     9 -->
    10 <!DOCTYPE concept
    10 <!DOCTYPE concept
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    12 <concept id="GUID-50BE8F1A-513A-433C-B045-66658FC226D7" xml:lang="en"><title>Client/server
    12 <concept id="GUID-50BE8F1A-513A-433C-B045-66658FC226D7" xml:lang="en"><title>Client/server communication</title><prolog><metadata><keywords/></metadata></prolog><conbody>
    13 communication</title><prolog><metadata><keywords/></metadata></prolog><conbody>
    13 <p><xref href="GUID-E530CBB9-C20D-5426-89AA-DC0281C05381.dita">Inter
    14 <p><xref href="GUID-E530CBB9-C20D-5426-89AA-DC0281C05381.dita">Inter Process
    14 Process Communication</xref> (IPC) is the basis for client/server
    15 Communication</xref> (IPC) is the basis for client/server architecture. Clients
    15 architecture. Clients and servers run in different threads, although
    16 and servers run in different threads, although not necessarily in different
    16 not necessarily in different processes, and communicate through message
    17 processes, and communicate through message passing protocol. There are no
    17 passing protocol. There are no direct pointers between the parties,
    18 direct pointers between the parties, leaving the integrity of the server and
    18 leaving the integrity of the server and its resources untouched by
    19 its resources untouched by clients. For more information, see <xref href="GUID-D4C7A714-F7BB-5A8D-A875-4796395B9B6C.dita">Introduction
    19 clients. For more information, see <xref href="GUID-D4C7A714-F7BB-5A8D-A875-4796395B9B6C.dita">Introduction to the
    20 to the client/server architecture</xref>.</p>
    20 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>.
    21 <p>Communication between the client and the server is managed by <xref href="GUID-E651C7A7-D6EB-533E-A97A-360D089DE7A5.dita">Inter-thread data
    22 Only the server and its clients can decode the parameters of the message.
    22 transfer</xref>. Only the server and its clients can decode the parameters
    23 This is also a security feature, because process boundaries are separators
    23 of the message. This is also a security feature, because process boundaries
    24 of memory space, direct pointers to the client's data structures cannot be
    24 are separators of memory space, direct pointers to the client's data
    25 delivered. All data not fitting in the provided integers must be represented
    25 structures cannot be delivered. All data not fitting in the provided
    26 as a <xref href="GUID-261ADCEC-C8C8-46E3-A7DC-804AC868C233.dita">descriptor</xref>,
    26 integers must be represented as a <xref href="GUID-261ADCEC-C8C8-46E3-A7DC-804AC868C233.dita">descriptor</xref>, 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) is delivered within the message.
    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)
    27 The server then uses safe inter-thread read and write functions to
    28 is delivered within the message. The server then uses safe inter-thread read
    28 access the provided descriptor.</p>
    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>
    29 <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_d0e12054_href.png"/></fig>
    30 <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_d0e12157_href.png"/></fig>
    32 <p>Consider the following issues when implementing the client-side API:</p>
    31 <p>Consider the following issues when implementing the client-side
       
    32 API:</p>
    33 <ul>
    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>
    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
    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
    35 launched.</p></li>
    36 messages.</p></li>
    36 <li><p>Once the server is running, create the connection
    37 <li><p>When packaging message arguments, make sure they are in a
    37 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
    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>
    38 are free message slots available to avoid lost messages.</p>
       
    39 </li>
       
    40 <li><p>When packaging message arguments, make sure they
       
    41 are in a format that the server understands. For more information,
       
    42 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>
    43 </ul>
    40 </conbody></concept>
    44 </conbody></concept>