Presentation on theme: "1 Symbian Client Server Architecture. 2 Client, who (a software module) needs service from service provider (another software module) Server, who provide."— Presentation transcript:
2 Client, who (a software module) needs service from service provider (another software module) Server, who provide service to other module, Symbian servers are typically used to manage shared access to system resources and services. It is efficient as servers process multiple clients at a time. 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. Second role of server: protect the integrity of the system as it can ensure that resources are shared properly and clients use them correctly –well-defined interface. 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.
3 Symbian Client Server Architecture Servers can also be used to provide asynchronous services, as they run in a separate thread/process. 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. Most of the Symbian OS services are provided using the client-server model – e.g., the window server for access to UI resources such as the screen and the keypad, the serial communication server, the telephony server.
4 Symbian Client Server Architecture A Symbian OS server always runs in a separate thread in regard to its clients (often in a separate process). The server has associated client-side code that formats requests to pass to server, via the kernel, and hides the implementation details of the private client server communication protocol.
5 Symbian Client Server Architecture User Privileges Kernel Executive Routine Server-ThreadClient-Thread Kernel Privileges Server ResponseRequest Client Interface Inter-Thread read/write Message Kernel
6 Symbian Client Server Architecture When the client and the server are running in different processes, they dont have access to each others virtual address space –they use a message-passing protocol. The communication channel is known as a session. This is created by the kernel, which intermediates between the client and the server. 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. Usually, the message carries data as well, but for more data transfer, IPC is necessary (Client and Server are running in different processes).
7 Symbian Client Server Architecture There are several kinds of server: System servers are started as part of the OS startup. Application servers are started only when clients need them. When the last client session closes, the server terminates (to save system resources). Some servers are required by only one application– they are started and closed by the application. A client can have one or more connections to a server through one or more sessions: Each connection can use a separate session; sessions are independent of each other within the client thread and each maintains its own context. The client can create sub-sessions within a single session; sub-sessions are more complex to implement server-side. The server may support sharable sessions; up to 255 threads in a client may share a single session.
8 Symbian Client Server Architecture A Client Server session is between one or more client threads (user mode) and a separate server thread. The server uses non-preemptive active object event-handling. If a client makes a request while the server is handling an event in RunL(), it has to wait until the completion of the method. Each session consumes resources on the server and kernel sides the client should minimize the number of sessions (either share a session or create sub- sessions).
9 Symbian Client Server Architecture Send Receive Request codep&q&r ServiceL(RMessage2 aMsg) aMsg.Complete(y) y aMsg.ReadL(1,…) aMsg.Int0() readwrite q r Response ServerClient TIpcArgs aMsg.WriteL(2,…) p
10 Symbian Client Server Architecture RSessionBase CreateSession() SendReceive() CSession2 ServiceL() RMessage2 Function() Complete() ReadL() WriteL() DServer Kernel 1..n has a Note : CServer2 Server Client DSession cookie == Address of Csession2 RServer2