User Tools

Site Tools


cdc:nos2.source:nam5871:netwait

NETWAIT

Table Of Contents

  • [00010] PROC NETWAIT1)
  • [00083] PROC NP$ERR
  • [00084] PROC NP$OSIF
  • [00085] PROC NP$RCL
  • [00086] PROC NP$SEND
  • [00088] PROC NP$SN
  • [00090] PROC NP$UCV
  • [00091] PROC NP$USI
  • [00093] PROC NP$RTIM
  • [00094] PROC NETXFRC

Source Code

NETWAIT.txt
  1. *DECK NETWAIT
  2. USETEXT AIPDEF
  3. USETEXT NP$MODE
  4. *IF DEF,XFR
  5. USETEXT NX$ACBF
  6. USETEXT NX$ACBX
  7. *ENDIF
  8. USETEXT NP$NWL
  9. USETEXT NP$STAT
  10. PROC NETWAIT((TIME),(FLAG));
  11. *IF DEF,IMS
  12. #
  13. *1DC NETWAIT
  14. *
  15. * 1. PROC NAME AUTHOR DATE
  16. * NETWAIT S. KRULEVITCH 78/11/10
  17. *
  18. * 2. FUNCTIONAL DESCRIPTION
  19. * THIS ROUTINE BUILDS A WAIT-REQUEST AND SENDS IT TO NIP WHERE
  20. * CONTROL WILL BE TAKEN AWAY FROM THE APPLICATION UNTIL A DATA
  21. * OR SUPERVISORY BLOCK IS AVAILABLE FOR UNTIL THE SPECIFIED
  22. * TIME-INTERVAL HAS BEEN EXCEEDED.
  23. *
  24. * 3. METHOD USED
  25. * PARALLEL MODE, IF ON, IS TEMPORARILY SUSPENDED UNTIL THE
  26. * NETWAIT REQUEST IS SENT AND COMPLETED BY NIP. IF AIP HAS A
  27. * SUPERVISORY MESSAGE IN AIP"S SMB(SUPERVISORY MESSAGE BUFFER)
  28. * OR THERE IS DATA QUEUED FOR THE APPLICATION WITHIN NIP,
  29. * AND THE NETWAIT IS NOT FORCED (FLAG = FALSE), THEN CONTROL
  30. * IS RETURNED TO THE USER WITHOUT SENDING THE NWL TO NIP.
  31. * S AND I BITS IN THE NSUP WORD IS UPDATED.
  32. *
  33. * 4. ENTRY CONDITIONS
  34. * TIME - MAXIMUM TIME DURATION OF WAIT, IN SECONDS
  35. * FLAG - INDICATES WHETHER TO WAIT FOR TIME TO ELAPSE (=TRUE)
  36. * OR TO WAIT UNTIL INPUT IS AVAILABLE (=FALSE)
  37. *
  38. * 5. EXIT CONDITONS
  39. * RETURNS NORMAL CONTROL TO APPLICATION
  40. * S$FLAG = TRUE IF THERE IS A SUPERVISORY MESSAGE IN AIP"S
  41. * I$FLAG - TRUE IF INPUT DATA QUEUED IN NIP
  42. * S$FLAG - TRUE IF A NON-EMPTY SMB OR SM QUEUED IN NIP
  43. * SMB AND NETWAIT IS NOT FORCED.
  44. *
  45. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  46. * AIPDEF NP$CRT NP$MODE NP$NWL
  47. * NP$STAT
  48. *
  49. * 7. ROUTINES CALLED
  50. * NP$ERR - PRINTS ERROR MESSAGES AND STOPS
  51. * NP$OSIF - SENDS OS REQUEST
  52. * NP$SEND - SENDS WORKLIST TO NIP
  53. * NP$SN - INCREMENTS STATISTICS COUNTER
  54. * NP$UCV - UPDATE CONTROL VARIABLES
  55. * NP$USI - UPDATE S,I AND D BITS IN THE NSUP WORD
  56. *
  57. * 8. DAYFILE MESSAGES
  58. * NETWORK APPLICATION ABORTED, RC = 33.
  59. * NETWAIT: REQUEST INVALID BEFORE NETON.
  60. *
  61. * NETWORK APPLICATION ABORTED, RC = 44.
  62. * NETWAIT: PREVIOUS REQUEST INCOMPLETE.
  63. *
  64. *
  65.  #
  66. *ENDIF
  67. BEGIN
  68.  
  69. *CALL NP$CRT
  70.  
  71. # #
  72. # FORMAL PARAMETERS: #
  73. # #
  74. ITEM TIME U; # MAXIMUM NETWAIT TIME #
  75. ITEM FLAG B; #INPUT AVAILABLE/TIMER EXPIRED#
  76. ITEM WAIT$FLAG B; # WAIT$FLAG = ID$FLAG IF #
  77. # WAITDEL FLAG IS FALSE #
  78. # ELSE WAIT$FLAG = WD$FLAG #
  79. # #
  80. # EXTERNAL ROUTINES: #
  81. # #
  82. XREF BEGIN
  83. PROC NP$ERR; #ERROR PROCESSING #
  84. PROC NP$OSIF; #ISSUE OS REQUEST #
  85. PROC NP$RCL; # ISSUE RECALL #
  86. PROC NP$SEND; #SEND NWL TO NIP VIA SSCALL #
  87. *IF DEF,STAT
  88. PROC NP$SN; #INCREMENTS STATISTICS COUNTER#
  89. *ENDIF
  90. PROC NP$UCV; # UPDATE CONTROL VARIABLES #
  91. PROC NP$USI; # UPDATE S AND I BITS IN NSUP #
  92. *IF,DEF,XFR
  93. PROC NP$RTIM; # GET CURRENT TIME #
  94. PROC NETXFRC; # CONTINUING TRANSFERING FILES #
  95. *ENDIF
  96. END #XREFS#
  97. # #
  98. ITEM
  99. *IF,DEF,XFR
  100. WAITIME , # WAIT TIL THIS TIME #
  101. *ENDIF
  102. PAR B=FALSE; #FLAG FOR PARALLEL MODE #
  103. #**********************************************************************#
  104. #
  105.   NETWAIT EXECUTION BEGINS HERE
  106. #
  107. *IF DEF,DEBUG
  108. *ENDIF
  109. IF NOT ACCEPTED
  110. THEN
  111. NP$ERR("33"); # REQUEST INVALID BEFORE NETON. #
  112. IF DEFER$PRO
  113. THEN
  114. NP$ERR("44"); # PREVIOUS REQUEST INCOMPLETE. #
  115. *IF DEF,STAT
  116. #
  117.   UPDATE STATISTICS IF STAT IS DEFINED
  118. #
  119. NP$SN(TYPE"WAIT"); #INCREMENT COUNTER #
  120. *ENDIF
  121. #
  122. *IF,DEF,XFR
  123.  
  124.   IF THERE ARE FILES BEING TRANSFERED OUSTANDING AND S BIT NOT
  125.   ON, CONTINUE TRANSFERING FILE UNTIL NO MORE FILE TO BE TRANSFERED
  126.   OR NO MORE THING TO DO, OR TIME TO WAIT HAS BEEN ESLAPSED.
  127.  
  128. *ENDIF
  129.   NO WAIT IF IT IS NOT A FORCED NETWAIT AND THERE ARE MESSAGES
  130.   AVAILABLE EITHER IN THE SMB OR QUEUED WITHIN NIP, OTHERWISE
  131.   THE APPLICATION WILL GO INTO RECALL EITHER UNTIL INPUT BECOMES
  132.   AVAILABLE OR THE TIME PERIOD SPECIFIED IN NETWAIT CALL EXPIRES.
  133. #
  134. *IF,DEF,XFR
  135. IF NUMFILEXFR NQ 0 # NEED TO DO FILE TRANSFER #
  136. AND SD$FLAG EQ 0 # S BIT IS NOT ON #
  137. THEN
  138. BEGIN
  139. NP$RTIM(TIME$WORD) ; # GET CURRENT TIME #
  140. WAITIME = ( TIME$SEC[0] + TIME);# WAIT TIL THIS TIME IN SECOND #
  141. # FILEXFR OUTSTANDING #
  142. XFR$COM = FALSE; # CLEAR XFR COMPLETION FLAG #
  143. NETXFRC; # CONTINUING FILE TRANSFER #
  144.  
  145. NP$RTIM(TIME$WORD) ; # GET NEW CURRENT TIME #
  146. TIME = WAITIME - TIME$SEC[0] ; # TIME LEFT FOR WAITING #
  147. IF XFR$COM # IF FILE XFR COMPLETED #
  148. THEN
  149. BEGIN
  150. XFR$COM = FALSE; # RESET FLAG #
  151. IF XFR$QB[0] # IF CALLED THROUGH NETWTQ #
  152. THEN
  153. BEGIN
  154. XFR$COM2[0] = TRUE; # SUSPEND SECOND NETWAIT #
  155. END
  156. GOTO ENDWAIT; # SKIP NETWAIT #
  157. END
  158. END
  159. *ENDIF
  160. IF WAITDEL # IF NETFUNC WAS ISSUED #
  161. THEN
  162. BEGIN
  163. WAIT$FLAG = NOT WD$FLAG; # CHECK FOR WD$FLAG IN DATA #
  164. END
  165. ELSE
  166. BEGIN # REGULAR PROCESSING #
  167. WAIT$FLAG = ID$FLAG EQ 0; # OTHERWISE CHECK FOR ID$FLAG #
  168. END
  169. IF (TIME GR 0 ) AND
  170. ( (FLAG ) OR
  171. ( (HEAD EQ FOOT ) AND
  172. (GMBHEAD EQ GMBFOOT) AND
  173. (WAIT$FLAG ) AND
  174. (SD$FLAG EQ 0 ) ) )
  175. THEN
  176. BEGIN # FORCED NETWAIT AND NO DATA AVAILABLE #
  177. NWL[NEXT] = 0; # FORMAT NETWAIT NWL ENTRY #
  178. NWL$ID[NEXT] = AWLID;
  179. BS = OPABHSIZ; # NWL ENTRY SIZE #
  180. NWL$OP[NEXT] = OP$WAIT;
  181. NWL[NEXT + 1] = 0; # CLEAR NEXT ENTRY #
  182. IF TIME GR 4095
  183. THEN
  184. WT$TIME[NEXT+1] = 4095;
  185. ELSE
  186. WT$TIME[NEXT+1] = TIME; # NETWAIT TIME #
  187. WT$FLAG[NEXT+1] = FLAG; # WHETHER A FORCED NETWAIT #
  188.  
  189. WT$WD[NEXT + 1] = WAITDEL; # SET WD FLAG IN WORKLIST #
  190. # IF NETFUNC NOT ISSUED BEFORE #
  191. # WAITDEL IS 0 HENCE WT$WD IS #
  192. # 0 #
  193. NP$UCV; # UPDATE CONTROL VARIABLES #
  194. PAR = PARALLEL;
  195. PARALLEL = FALSE; # ALWAYS GIVE UP CPU ON A WAIT #
  196. NP$SEND; # SEND NWL TO NIP #
  197. PARALLEL = PAR; # RESTORE PARALLEL FLAG #
  198. END
  199. ELSE
  200. IF SD$FLAG[0] EQ 0 AND HEAD EQ FOOT
  201. THEN # PUT APP IN SHORT RECALL IF NO SUP MSG #
  202. NP$RCL(0);
  203. #
  204.   UPDATE THE S AND I BITS IN THE NSUP WORD
  205. #
  206. NP$USI;
  207.  
  208. ENDWAIT: RETURN;
  209. END #NETWAIT#
  210. TERM
1)
TIME),(FLAG
cdc/nos2.source/nam5871/netwait.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator