*DECK IPPSETO
USETEXT TEXTIPL
PROC IPPSETO (SOCKID, BLCK, TIME, SOCKSTATUS);
*CALL COPYRITE CDCNET - COPYRIGHT CONTROL DATA. 1992.
# TITLE IPPSETO - SET SOCKET OPTIONS #
BEGIN # IPPSETO #
#
**** IPPSETO SET SOCKET OPTIONS
*
* THIS PROCEDURE ALLOWS THE BLOCKING AND WAIT TIME OPTIONS OF A
* SOCKET TO BE MODIFIED.
*
* PROC IPPSETO
*
* ENTRY SOCKID = INTEGER VALUE OF A SOCKET.
* BLCK = BOOLEAN FOR BLOCKING SUPPORTED ON SOCKET.
* TIME = TIME TO WAIT IF BLOCK SUPPORTED.
*
* EXIT SOCKSTATUS = COMPLETION STATUS
*
* METHOD VERIFY THE SOCKET IS CONNECTED. IF THE SOCKET HAS
* DISCONNECTED FROM NAM, RETURN AN ABORT STATUS.
* UPDATE THE SOCKID ENTRY WITH THE SUPPLIED STATUS OF
* BLOCKING AND THE WAIT TIME. THESE ARE USED WHILE
* FOR NETWORK RESPONSES TO SEND AND RECEIVE REQUESTS.
#
#
**
#
ITEM SOCKID I; # SOCKET IDENTIFIER #
ITEM BLCK B; # BLOCKING SUPPORTED ON SOCKET #
ITEM TIME I; # TIME TO WAIT IF BLOCKING #
ITEM SOCKSTATUS S:SOCKSTAT; # RETURNED SOCKET STATUS #
CONTROL EJECT;
#
**** START MAIN PROCEDURE
#
IF (ACN$ABORT [SOCKID])
THEN
BEGIN # CONNECTION ABORTED #
SOCKSTATUS = S"ABORT";
RETURN;
END
IF NOT ACN$CONNECT [SOCKID]
THEN
BEGIN
SOCKSTATUS = SOCKSTAT"INVALIDST";
RETURN;
END
IF TIME GR 4095
THEN
BEGIN
ACN$WAITIME [SOCKID] = 4095;
END
ELSE
BEGIN
ACN$WAITIME [SOCKID] = TIME;
END
ACN$BLOCK [SOCKID] = BLCK;
SOCKSTATUS = S"OK";
RETURN; # RETURN TO CALLER #
END # IPPSETO #
TERM