TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)
Writing Pathway Servers
NonStop TS/MP Pathsend and Server Programming Manual–132500
4-13
Writing Context-Sensitive Servers
Writing Context-Sensitive Servers
If you are writing a context-sensitive Pathway server, you must follow the guidelines in 
Basic Pathway Server Programming earlier in this section and also perform additional 
programming tasks. This subsection describes these additional tasks and other 
considerations for programming context-sensitive servers.
When you use context-sensitive Pathway servers, the requester and server must be 
designed to work together. The context-sensitive Pathsend procedure calls used by the 
requester, described in Section 3, Writing Pathsend Requesters
, and Section 5, Pathsend 
Procedure Call Reference, convey dialog information to the server, and the server 
conveys dialog information in its reply. 
Functions of a Context-Sensitive Server
In addition to the functions performed by all Pathway servers, a context-sensitive server 
must do the following:
•
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 a server receives a message on $RECEIVE, it checks dialog flag bits <12:13> 
returned by the file-system procedure FILE_GETRECEIVEINFO_ or the Common 
Run-Time Environment (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.
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.










