Symbian3/SDK/Source/GUID-D4C7A714-F7BB-5A8D-A875-4796395B9B6C.dita
changeset 7 51a74ef9ed63
parent 0 89d6a7a84779
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-D4C7A714-F7BB-5A8D-A875-4796395B9B6C" xml:lang="en"><title>Introduction
       
    13 to the client-server architecture</title><shortdesc>Provides a high-level description of the Symbian platform client-server
       
    14 architecture.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    15 <ul>
       
    16 <li id="GUID-31FDC700-8C84-58C7-A18A-A3398A5BA6AD"><p> <xref href="GUID-D4C7A714-F7BB-5A8D-A875-4796395B9B6C.dita#GUID-D4C7A714-F7BB-5A8D-A875-4796395B9B6C/GUID-177DE161-3EAD-5623-93D7-7DE0A631F193">Why use a server?</xref>  </p> </li>
       
    17 <li id="GUID-23B5C6F8-6860-5A5F-9C89-BC25A3CAC6B9"><p> <xref href="GUID-D4C7A714-F7BB-5A8D-A875-4796395B9B6C.dita#GUID-D4C7A714-F7BB-5A8D-A875-4796395B9B6C/GUID-1B3F9BF2-D909-5C5F-8380-A2D9FDE0D05B">Symbian platform client/server</xref>  </p> </li>
       
    18 </ul>
       
    19 <section id="GUID-177DE161-3EAD-5623-93D7-7DE0A631F193"><title>Why use a server?</title> <p>It
       
    20 is usually appropriate to provide services through a server: </p> <ul>
       
    21 <li id="GUID-A16F540F-2A32-5FAE-82F7-A7DC06E694B9"><p>when the services involve
       
    22 management of one or more shared system resources. </p> <p>For example, the
       
    23 File Server manages all files and file systems on behalf of all client programs.
       
    24 The file server may therefore ensure that all file resources are correctly
       
    25 shared. Similarly, the Window Server allows all applications to share the
       
    26 machine's screen, keyboard, and pointer devices. </p> </li>
       
    27 <li id="GUID-A69E1C2D-350C-5B34-B448-C7FBC0DDDC47"><p>when a degree of isolation
       
    28 is required between client and server. </p> <p>Since client and server run
       
    29 in separate threads, they may also run in separate processes, with separate
       
    30 address spaces. This means there is no possibility of communication between
       
    31 them except by the interface provided by the server and its client interface.
       
    32 Thus, misbehaved clients cannot corrupt the server or any of the resources
       
    33 it manages on behalf of other clients. </p> <p>The File Server architecture
       
    34 is strongly motivated by this requirement. </p> </li>
       
    35 <li id="GUID-D7B7C91B-9F6B-53AC-8177-16CB4ECDF5A7"><p>when asynchronous services
       
    36 are required. </p> <p>Asynchronous requests can be handled using Kernel services
       
    37 (e.g. timers) and active objects within an application thread. However, when
       
    38 the completion of a request is some time in the future, and the application
       
    39 program making the request might no longer be present, a continuously-running
       
    40 server is appropriate. </p> </li>
       
    41 </ul> <p>Most servers are motivated by a combination of requirements such
       
    42 as these. </p> <p>There are three distinct aspects to the service provided
       
    43 by a server: </p> <ul>
       
    44 <li id="GUID-30ADCD43-2C5A-56C0-8992-160BEFA0F58A"><p>a server program, which
       
    45 runs in its own thread </p> </li>
       
    46 <li id="GUID-8B58B03C-B548-5B7C-B2AB-7491574353C4"><p>several client programs,
       
    47 each running in their own thread </p> </li>
       
    48 <li id="GUID-AD63FE65-65C0-5DF4-BEEE-B4DDF481521E"><p>a client interface,
       
    49 provided by the server, for use by each client program </p> </li>
       
    50 </ul> </section>
       
    51 <section id="GUID-1B3F9BF2-D909-5C5F-8380-A2D9FDE0D05B"><title>Symbian platform
       
    52 client/server</title> <p>In Symbian platform, the server defines a client
       
    53 interface API which the client uses to request specific services. The client
       
    54 and server programs run in different threads, often in different processes,
       
    55 and so cannot directly access each other's address space. They use a message
       
    56 passing protocol to communicate. </p> <p>All servers have a name which is
       
    57 passed to the server when it is started. A client finds a server through its
       
    58 name. </p> <p>The channel of communication between a client and a server is
       
    59 known as a <i>session</i>. To make a server request, the client sends a message
       
    60 to the server over the session. The message includes a 32-bit request type
       
    61 code, and up to four 32-bit parameters. The server may use data transfer services
       
    62 to send and receive additional data. When it has finished servicing the message,
       
    63 a 32-bit completion code is returned to the client. All client-server communication
       
    64 is mediated by the Kernel. </p> <p>A session can be used by all threads in
       
    65 a process, and an also be shared by all threads across all processes, and
       
    66 not just by the thread that connected to the server. Such a session is said
       
    67 to be sharable. </p> <p>A server must indicate that it can support sharable
       
    68 sessions. Default behaviour is always to create non-sharable sessions. </p> <p>The
       
    69 Symbian platform provides several servers. </p> </section>
       
    70 </conbody></concept>