Click on the following link to download the example: ServerApp.zip
Click: browse to view the example code.
This example demonstrates a minimal server application making use of a minimal UI application.
The example application consists of three sub-projects:
A harness project which uses the Client API to generate a client request and trigger the server application
A service_support project consisting of Service Client Support and Service Implementation Support. Both client-side and server application-side support are built into a single DLL which encapsulates the IPC protocol between client and server.
A server_application project that provides the entry point into the server application. This sub-project consists of the Server class and of the actual Application.
Service Client Support class (Client API)
Client side service support is provided through an REikAppServiceBase derived class, RServAppService. This class implements the following required functions:
RApaAppServiceBase::ServiceUid() const, a pure virtual function
RServAppService::Send() which sends a request to the server
Service Implementation Support class (Server Implementation API)
A CApaAppServiceBase derived class, CServAppSession, provides Service Implementation Support (support for the sessions connected to the server). The main purpose of this class is to override the pure virtual function CSession2::ServiceL(), such that a call to the appropriate service support code is made.
In this example, CServAppSession defines a pure virtual function, Display(), the functionality of which is implemented in the server application.
Server class
The server class CServAppServer is derived from CEikAppServer and implements the function CApaAppServer::CreateServiceL(). This function instantiates a session to handle the client request (by implementing an appropriate service).
Session class
CMinimalSession is a CApaAppServiceBase derived class that represents the session connected to the server. In order to handle the client request, this session class overrides the pure virtual function CServAppSession::Display(). Thus, the client request is implemented.
UI classes
Application class
Document class
Application UI class
View class
These four classes are almost the same as those in the minimal UI application example. A couple of slight modifications have been made:
Service Support
RApaAppServiceBase -> REikAppServiceBase -> RServAppService
CApaAppServiceBase -> CServAppSession
Server Application
CApaAppServer -> CEikAppServer -> CServAppServer
CServAppSession -> CMinimalSession
CApaApplication -> CEikApplication -> CExampleApplication
CEikDocument -> CExampleDocument
CEikAppUi -> CExampleAppUi
CCoeControl -> CExampleAppView
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.