FORTRAN Reference Manual
Interprocess Communication
FORTRAN Reference Manual—528615-001
14-19
Message Queuing
When the end of the data file is reached, control passes to statement label 60 (line 72). 
Here, in a loop from line 73 to line 77, the server sends an end-of-file indication (error 
code 1) to each requester that has an outstanding request.
Example 14-3. Example Queued Server (Part 2 of 3)
48 20 CONTINUE
49 READ (UNIT=5, SOURCE=source, LENGTH=length) request
50 IF (system) THEN
51 IF (request(1) .EQ. -30 .AND.
52 + MOD(request(2),16) .GT. 1) THEN
53 replycod = 28
54 ELSE
55 replycod = 0
56 END IF
57 WRITE (UNIT=6, MSGNUM=msgnum, REPLY=replycod)
58 GO TO 20
59 END IF
60 IF (matchnew(request, length/2, record)) THEN
61 WRITE (UNIT=6, MSGNUM=msgnum) record
62 GO TO 10
63 ELSE
64 messno(rqr) = msgnum
65 limit = length/2
66 dest this rqr(rqr) = limit
67 DO 30 I = 1, limit
68 dest(rqr,I) = request(I)
69 30 CONTINUE
70 END IF
71 GO TO 20
72 60 CONTINUE
73 DO 70 I = 1,norqr
74 IF (messno(I) .GE. 0) THEN
75 WRITE (UNIT=6,REPLY=1, MSGNUM=messno(I))
76 END IF
77 70 CONTINUE
78 90 CONTINUE
79 READ (UNIT=5,END=100, SOURCE=source) request
80 IF (system) THEN










