User Tools

Site Tools


cdc:nos2.source:nam5871:ippseto

IPPSETO

Table Of Contents

  • [00003] PROC IPPSETO (SOCKID, BLCK, TIME, SOCKSTATUS)
  • [00005] IPPSETO - SET SOCKET OPTIONS

Source Code

IPPSETO.txt
  1. *DECK IPPSETO
  2. USETEXT TEXTIPL
  3. PROC IPPSETO (SOCKID, BLCK, TIME, SOCKSTATUS);
  4. *CALL COPYRITE CDCNET - COPYRIGHT CONTROL DATA. 1992.
  5. # TITLE IPPSETO - SET SOCKET OPTIONS #
  6.  
  7. BEGIN # IPPSETO #
  8. #
  9. **** IPPSETO SET SOCKET OPTIONS
  10. *
  11. * THIS PROCEDURE ALLOWS THE BLOCKING AND WAIT TIME OPTIONS OF A
  12. * SOCKET TO BE MODIFIED.
  13. *
  14. * PROC IPPSETO
  15. *
  16. * ENTRY SOCKID = INTEGER VALUE OF A SOCKET.
  17. * BLCK = BOOLEAN FOR BLOCKING SUPPORTED ON SOCKET.
  18. * TIME = TIME TO WAIT IF BLOCK SUPPORTED.
  19. *
  20. * EXIT SOCKSTATUS = COMPLETION STATUS
  21. *
  22. * METHOD VERIFY THE SOCKET IS CONNECTED. IF THE SOCKET HAS
  23. * DISCONNECTED FROM NAM, RETURN AN ABORT STATUS.
  24. * UPDATE THE SOCKID ENTRY WITH THE SUPPLIED STATUS OF
  25. * BLOCKING AND THE WAIT TIME. THESE ARE USED WHILE
  26. * FOR NETWORK RESPONSES TO SEND AND RECEIVE REQUESTS.
  27. #
  28.  
  29. #
  30. **
  31. #
  32. ITEM SOCKID I; # SOCKET IDENTIFIER #
  33. ITEM BLCK B; # BLOCKING SUPPORTED ON SOCKET #
  34. ITEM TIME I; # TIME TO WAIT IF BLOCKING #
  35. ITEM SOCKSTATUS S:SOCKSTAT; # RETURNED SOCKET STATUS #
  36. CONTROL EJECT;
  37. #
  38. **** START MAIN PROCEDURE
  39. #
  40.  
  41. IF (ACN$ABORT [SOCKID])
  42. THEN
  43. BEGIN # CONNECTION ABORTED #
  44. SOCKSTATUS = S"ABORT";
  45. RETURN;
  46. END
  47.  
  48. IF NOT ACN$CONNECT [SOCKID]
  49. THEN
  50. BEGIN
  51. SOCKSTATUS = SOCKSTAT"INVALIDST";
  52. RETURN;
  53. END
  54.  
  55. IF TIME GR 4095
  56. THEN
  57. BEGIN
  58. ACN$WAITIME [SOCKID] = 4095;
  59. END
  60. ELSE
  61. BEGIN
  62. ACN$WAITIME [SOCKID] = TIME;
  63. END
  64.  
  65. ACN$BLOCK [SOCKID] = BLCK;
  66. SOCKSTATUS = S"OK";
  67.  
  68. RETURN; # RETURN TO CALLER #
  69.  
  70. END # IPPSETO #
  71.  
  72. TERM
cdc/nos2.source/nam5871/ippseto.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator