User Tools

Site Tools


cdc:nos2.source:nam5871:ipuwait

IPUWAIT

Table Of Contents

  • [00003] PROC IPUWAIT (SECONDS)
  • [00005] IPUWAIT - APPLICATION WAIT TIMER
  • [00033] PROC IPINITH
  • [00034] PROC NETWAIT
  • [00035] PROC RTIME

Source Code

IPUWAIT.txt
  1. *DECK IPUWAIT
  2. USETEXT TEXTIPL
  3. PROC IPUWAIT (SECONDS);
  4. *CALL COPYRITE CDCNET - COPYRIGHT CONTROL DATA. 1992.
  5. # TITLE IPUWAIT - APPLICATION WAIT TIMER #
  6.  
  7. BEGIN # IPUWAIT #
  8. #
  9. **** IPUWAIT APPLICATION WAIT TIMER.
  10. *
  11. * THIS PROCEDURE CALLS CAUSES THE APPLICATION TO SUSPEND FOR THE
  12. * SPECIIED TIME.
  13. *
  14. * PROC IPUWAIT
  15. *
  16. * ENTRY SECONDS = INTEGER VALUE OF SECONDS TO WAIT
  17. *
  18. * EXIT TIME ELAPSED.
  19. *
  20. * METHOD OBTAIN THE CURRENT TIME. CALL *NETWAIT* FOR THE
  21. * SPECIFIED TIME. CHECK NAM FOR INPUT. THE *NETWAIT*
  22. * TIMER WILL EXPIRE EARLY IF NAM HAS DATA FOR THE
  23. * APPLICATION. IF THIS WAS THE CASE, CONTINUE CALLING
  24. * *IPINITH* TO PROCESS ANY OTHER POSSIBLE INPUT UNTIL THE
  25. * TIME HAS EXPIRED.
  26. #
  27.  
  28. #
  29. **** PROC IPUWAIT - XREF LIST
  30. #
  31. XREF
  32. BEGIN
  33. PROC IPINITH; # NAM INPUT TRAFFIC HANDLER #
  34. PROC NETWAIT; # SUSPEND NAM APPLICATION #
  35. PROC RTIME; # REAL TIME CLOCK #
  36. END
  37. #
  38. **
  39. #
  40.  
  41. ITEM SECONDS I; # SECONDS TO WAIT #
  42.  
  43. ITEM INDEX I; # LOOP COUNTER #
  44. ITEM LOOP I; # LOOP COUNTER #
  45. ITEM WAITLOOP I; # WAIT LOOP COUNTER #
  46. CONTROL EJECT;
  47. #
  48. **** START MAIN PROCEDURE
  49. #
  50.  
  51. RTIME (BWT$TIME); # CURRENT TIME #
  52. BWT$EXPIRE [0] = BWT$SECONDS [0] + SECONDS;
  53.  
  54. NETWAIT (SECONDS, 0); # CALL NETWAIT FOR INITIAL WAIT #
  55.  
  56. BLOCK = TRUE;
  57. IPINITH; # NAM INPUT TRAFFIC HANDLER #
  58.  
  59. FOR INDEX = 0
  60. DO
  61. BEGIN # LOOP UNTIL TIMER EXPIRES #
  62. RTIME (BWT$TIME);
  63.  
  64. IF (BWT$SECONDS [0] GQ BWT$EXPIRE [0])
  65. THEN
  66. BEGIN # TIMER EXPIRED #
  67. RETURN;
  68. END
  69.  
  70. WAITLOOP = (BWT$EXPIRE [0] - BWT$SECONDS [0]) / 2 + 1;
  71. FOR LOOP = 1 STEP 1 UNTIL WAITLOOP
  72. DO
  73. BEGIN
  74. IPINITH; # NAM INPUT TRAFFIC HANDLER #
  75. END
  76. END # LOOP UNTIL TIMER EXPIRES #
  77.  
  78. END # IPUWAIT #
  79.  
  80. TERM
cdc/nos2.source/nam5871/ipuwait.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator