TS/MP Pathsend and Server Programming Manual (H06.05+, J06.03+)
Section 3, “Writing Pathsend Requesters” (page 51), and Section 5, “Pathsend Procedure Call
Reference” (page 75), convey dialog information to the server, and the server conveys dialog
information in its reply.
NOTE: The SCREEN COBOL language does not support context sensitivity; therefore, to take
advantage of context sensitivity, you must use either a Pathsend requester or a GDSX front-end
process that uses the GDSX pseudo Pathsend procedures.
Functions of a Context-Sensitive Server
In addition to the functions performed by all Pathway servers, a context-sensitive server must:
• Detect a newly established dialog
• Receive, service, and reply to messages associated with a dialog
• Correlate messages with a dialog
• Continue a dialog
• Terminate a dialog
• Abort a dialog
• Detect an aborted dialog
It is simpler to code a context-sensitive server if you allow only one dialog at a time. To impose
this restriction, you must configure the server class with a MAXLINKS value of 1. If MAXLINKS is
set to a value other than 1, you must code your server to save multiple dialog contexts and to
switch context, if needed, on each incoming request.
When the server receives an incoming request on $RECEIVE, it can retrieve the sending processes
process handle (phandle) and the file number by calling the FILE_GETRECEIVEINFO_ procedure
or the CRE_Receive_Read_ procedure. The server process uses this information for context
management.
When a server receives a message on $RECEIVE, it checks dialog flag bits <12:13> returned by
the file-system procedure FILE_GETRECEIVEINFO_ or the CRE procedure CRE_Receive_Read_ to
determine whether this is the first message of a new dialog or a message within an existing dialog.
A value of zero in these two bits indicates a context-free send operation. In addition, the server
can check dialog flag bit 14 to determine the model used by the requester for associating
transactions with dialogs.
For the FILE_GETRECEIVEINFO_ procedure syntax, see the Guardian Procedure Calls Reference
Manual. For the CRE_Receive_Read_ procedure syntax, see the Common Run-Time Environment
(CRE) Programmer’s Guide.
NOTE: CRE_Receive_Read_ and the other CRE routines are callable only from TAL, pTAL,
FORTRAN, and COBOL85 programs and are used when you are writing mixed-language programs.
You cannot use CRE routines along with Guardian procedure calls. For more information about
the use of the CRE routines, refer to the Common Run-Time Environment (CRE) Programmer’s Guide.
Detecting a Newly Established Dialog
A context-sensitive server detects a newly established dialog by checking bits <12:13> of the
dialog flags returned by the FILE_GETRECEIVEINFO_ or the CRE_Receive_Read_ procedure. If the
value in these bits is 1, the message is the first in a new dialog. This message corresponds to the
requester’s call to the SERVERCLASS_DIALOG_BEGIN_ procedure; this call starts the dialog and
usually also sends data.
Receiving, Servicing, and Replying to Messages in a Dialog
The server receives, services, and replies to messages in a dialog by doing these:
Writing Context-Sensitive Servers 71










