FORTRAN Reference Manual

Interprocess Communication
FORTRAN Reference Manual528615-001
14-7
$RECEIVE as an Input/Output File
$RECEIVE as an Input/Output File
In this case, the server opens $RECEIVE in the I-O mode to receive requests and
reply to them through the same file. Each request is acted upon and paired with a
message sent back to the requester in response to the request message:
A requester might contain the following statements:
...
CHARACTER*80 request
CHARACTER*132 reply
...
OPEN (UNIT=1,FILE='$SERVE',SPACECONTROL='NO')
...
READ (UNIT=1,PROMPT=request) reply
...
Note that a READ from a process with a PROMPT causes a WRITEREAD to be
executed. The SPACECONTROL='NO' specifier in the OPEN statement ensures that
all the characters transmitted are treated as data, and prevents extraneous message
traffic.
VST1406.vsd
request message
Requester
Process
Server
Process
reply message