TS/MP Pathsend and Server Programming Manual (G06.24+, H06.03+)

Writing Pathway Servers
NonStop TS/MP Pathsend and Server Programming Manual132500
4-14
Detecting a Newly Established Dialog
For the syntax of the FILE_GETRECEIVEINFO_ procedure, refer to the Guardian
Procedure Calls Reference Manual. For the syntax of the CRE_Receive_Read_
procedure, 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 the following:
1. Reads a message from $RECEIVE by using the $RECEIVE reading mechanism for
the programming language, such as a call to the Guardian READUPDATE or
READUPDATEX procedure.
2. Checks 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. If the value is 2, the message is for an existing dialog.
3. Checks the value of bit 14 of the dialog flags if the TMF subsystem is being used,
the server is enforcing transaction commit protection during the dialog, and the
value of bits <12:13> of the dialog flags is 1 (first message in a new dialog). If the
value of bit 14 is 1, aborts the dialog by replying with FEEOF (1).
4. Processes the message and performs the requested services.
5. Issues a reply by using the language’s $RECEIVE writing mechanism, such as a call
to the REPLY or REPLYX procedure.
Dialog Control
The server controls the dialog by means of a file-system error code it returns in its reply.
Table 4-1 shows the effect of the reply error codes.
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.