Interaction within the server

A server consists of the services that you provide to clients, along with the code that controls these services. By this definition, a server that provides only one simple RPC service includes:

In the most common model, you define the dispatcher and dispatcher implementation classes using RPC Services. You use the Service Access framework to create a service definition and Message Streams to create a stream (derived from TReceiverStream). You then define your own dispatcher loop or use the TDispatcherThread utility class.

Based on these requirements, a server:

  1. Instantiates a service definition using TStandardServiceDefinition.
  2. Creates a new TRequestReceiverStream instance, passing the TStandardServiceDefinition. TRequestReceiverStream adopts the service definition object.
  3. Instantiates the dispatcher, passing in a pointer to the dispatcher implementation object.
  4. Instantiates TDispatcherThread, passing the pointer to the TRequestReceiverStream and a pointer to the dispatcher.
TDispatcherThread intercepts any incoming requests and routes them to the dispatcher. Once the dispatcher formulates a reply, TDispatcherThread sends the reply back to the caller. All objects necessary to process the request (aside from any objects that the implementation might create) now exist.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker