Symbian3/SDK/Source/GUID-D4C7A714-F7BB-5A8D-A875-4796395B9B6C.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

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