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:
- A dispatcher object
- An object defining the dispatcher implementation
- A service definition to provide a service access point for the client
- A stream object to use for incoming requests and outgoing replies
- A dispatcher loop that waits for and processes incoming requests
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:
- Instantiates a service definition using TStandardServiceDefinition.
- Creates a new TRequestReceiverStream instance, passing the TStandardServiceDefinition. TRequestReceiverStream adopts the service definition object.
- Instantiates the dispatcher, passing in a pointer to the dispatcher implementation object.
- 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