User Tools

Site Tools


cdc:nos2.source:nam5871:ippstas

IPPSTAS

Table Of Contents

  • [00003] PROC IPPSTAS (SOCKID, STATE, READ, WRITE, SOCKSTATUS)
  • [00005] IPPSTAS - STATUS SOCKET
  • [00040] PROC IPINITH

Source Code

IPPSTAS.txt
  1. *DECK IPPSTAS
  2. USETEXT TEXTIPL
  3. PROC IPPSTAS (SOCKID, STATE, READ, WRITE, SOCKSTATUS);
  4. *CALL COPYRITE CDCNET - COPYRIGHT CONTROL DATA. 1992.
  5. # TITLE IPPSTAS - STATUS SOCKET #
  6.  
  7. BEGIN # IPPSTAS #
  8. #
  9. **** IPPSTAS STATUS SOCKET
  10. *
  11. * THIS PROCEDURE QUERYS THE STATUS OF A SOCKET. THE SOCKET STATE
  12. * AND THE ABILITY TO CURRENTLY RECEIVE OR SEND DATA ARE THE STATUS
  13. * VALUES RETURNED.
  14. *
  15. * PROC IPPSTAS
  16. *
  17. * ENTRY SOCKID = INTEGER VALUE OF A SOCKET.
  18. *
  19. * EXIT STATE = CURRENT STATE OF THE SOCKET AS DEFINED BY
  20. * *CONNECTSTATE*.
  21. * READ = BOOLEAN, TRUE IF DATA QUEUED.
  22. * WRITE = BOOLEAN, TRUE IF NOT AT APPLICATION BLOCK
  23. * LIMIT.
  24. * SOCKSTATUS = COMPLETION STATUS
  25. *
  26. * METHOD CALL THE NAM INPUT HANDLER TO CHECK THE NETWORK.
  27. * VERIFY THE SOCKET IS CONNECTED. IF THE SOCKET HAS
  28. * DISCONNECTED FROM NAM, RETURN AN ABORT STATUS.
  29. * SET *STATE* TO THE CURRENT SOCKET STATE, SET *READ*
  30. * TO THE ACN$DATAV VALUE, SET WRITE TO TRUE IF THE
  31. * CONNECTION IS NOT AT THE APPLICATION BLOCK LIMIT AS
  32. * DEFINED IN THE ACN ENTRY FOR THE SOCKET.
  33. #
  34.  
  35. #
  36. **** PROC IPPSTAS - XREF LIST
  37. #
  38. XREF
  39. BEGIN
  40. PROC IPINITH; # NAM INPUT TRAFFIC HANDLER #
  41. END
  42. #
  43. **
  44. #
  45. ITEM SOCKID I; # SOCKET IDENTIFIER #
  46. ITEM STATE S:CONNECTSTATE; # SOCKET STATE #
  47. ITEM READ B; # DATA AVAILABLE #
  48. ITEM WRITE B; # WRITE ALLOWED #
  49. ITEM SOCKSTATUS S:SOCKSTAT; # RETURNED SOCKET STATUS #
  50. CONTROL EJECT;
  51. #
  52. **** START MAIN PROCEDURE
  53. #
  54.  
  55. BLOCK = FALSE; # SET NAM HANDLER NOT TO WAIT #
  56. IPINITH; # CALL NAM HANDLER #
  57.  
  58. SOCKSTATUS = S"OK";
  59. READ = ACN$DATAV [SOCKID];
  60. WRITE = (ACN$OBC [SOCKID] LS ACN$ABL [SOCKID]);
  61.  
  62. IF (ACN$ABORT [SOCKID])
  63. THEN
  64. BEGIN # CONNECTION ABORTED #
  65. SOCKSTATUS = S"ABORT";
  66. READ = FALSE;
  67. WRITE = FALSE;
  68. END
  69.  
  70. IF NOT ACN$CONNECT [SOCKID]
  71. THEN
  72. BEGIN
  73. SOCKSTATUS = SOCKSTAT"INVALIDST";
  74. READ = FALSE;
  75. WRITE = FALSE;
  76. END
  77.  
  78. STATE = ACN$STATE [SOCKID];
  79.  
  80. RETURN; # RETURN TO CALLER #
  81.  
  82. END # IPPSTAS #
  83.  
  84. TERM
cdc/nos2.source/nam5871/ippstas.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator