1.4.1 Basic Server Operation

To build server processes, applications combine their service subroutines with a main() process provided by the Oracle Tuxedo system. This system-supplied main() is a set of predefined functions. It performs server initialization and termination and allocates buffers that can be used to receive and dispatch incoming requests to service routines. All of this processing is transparent to the application.

The following figure summarizes, in pseudo-code, the interaction between a server and a service subroutine.

Figure 1-2 Pseudo-code for a Request/Response Server and a Service Subroutine


Pseudo-code for a Request/Response Server and a Service Subroutine Diagram

After initialization, an ATMI server allocates a buffer, waits until a request message is delivered to its message queue, dequeues the request, and dispatches it to a service subroutine for processing. If a reply is required, the reply is considered part of request processing.

The conversational paradigm is somewhat different from request/response, as illustrated by the pseudo-code in the shown in the following figure.

Figure 1-3 Pseudo-code for a Conversational Service Subroutine


Pseudo-code for a Conversational Service Subroutine Diagram

The Oracle Tuxedo system-supplied main() process contains the code needed to enroll a process as an ATMI server, advertise services, allocate buffers, and dequeue requests. ATMI functions are used in service subroutines that process requests. When you are ready to compile and test your service subroutines, you must link edit them with the server main() and generate an executable server. To do so, run the buildserver command.