TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Writing Pathsend Requesters
NonStop TS/MP Pathsend and Server Programming Manual–132500
3-8
Context-Sensitive Pathsend Programming
Context-Sensitive Pathsend Programming
If you are writing a context-sensitive Pathsend program, you must follow the guidelines
in the previous subsection, Basic Pathsend Programming, and also perform additional
programming tasks. This subsection describes these additional tasks and other
considerations for context-sensitive programming.
Context-sensitive Pathsend programming involves establishing a dialog between a
requester and a server process in a server class, and then sending messages within the
dialog. After the dialog is established, the same server process is used for all the
messages in the dialog; therefore, the server can retain context between send operations.
A requester starts a dialog by calling SERVERCLASS_DIALOG_BEGIN_. This
procedure returns a dialog identifier to be used on subsequent server-class send
operations, which are made by calling SERVERCLASS_DIALOG_SEND_. The
requester can use multiple calls to SERVERCLASS_DIALOG_BEGIN_, and the
resulting dialog identifiers, to engage in multiple simultaneous dialogs. As in the
context-free case, the requester can call SERVERCLASS_SEND_INFO_ after a server-
class send operation to get detailed information about send initiation and completion
errors.
Either the requester or the server can abort the dialog, but only the server can end it.
(The server aborts the dialog by returning file-system error 1 (FEEOF) in its reply; it
ends the dialog by returning file-system error 0 (FEOK).) To abort the dialog, the
requester calls SERVERCLASS_DIALOG_ABORT_. The requester calls
SERVERCLASS_DIALOG_END_ to clean up resources after the server has ended or
aborted the dialog.
As in context-free programming, the requester can perform context-sensitive server-class
send operations either waited or nowait. The requester receives an error indication if the
server process has terminated or if it has ended or aborted the dialog.
To participate in a dialog with a context-sensitive Pathway requester, a server must
perform additional tasks besides those required of all servers. These additional tasks are
described under Writing Context-Sensitive Servers
in Section 4.
Using Context-Sensitive Requesters With Context-Free Servers
Context-sensitive requesters can perform single-send dialogs with Pathway servers that
are coded to be context-free. However, if these servers check for system messages and
they use the Common Run-Time Environment (CRE), they must be modified to
recognize and respond to Pathsend dialog abort system messages. Section 4, Writing
Pathway Servers, describes how to code servers to handle these system messages.
Resource Utilization
On a requester’s first SERVERCLASS_DIALOG_BEGIN_ call, an extended segment is
added to the requester’s segment space for use as a workspace. This segment can be up
to 64 KB in size. It is deallocated when the requester process is terminated.