Use the SHUTDOWN command to
shut down all or part of a duplex connection.
Format
.-,--BOTH-.
>>-SOCKET--(--"SHUTDOWN"--,--socketid--+---------+--)----------><
'-,--how--'
Parameters
- socketid
- The socket descriptor of the connected socket.
- how
- Specifies which operations are to be ended. The following parameters
are supported:
- BOTH
- Ends further send and receive operation on the socket. By default,
this is the value of the how parameter. The value
2 is supported also.
- SEND
- Ends further send operations on the socket. The following values
are supported also: 1, TO, SENDING, WRITE, WRITING.
- READ
- Ends further receive operations on the socket. The following values
are supported also: 0, FROM, READING, RECEIVE, RECEIVING.
Returned value
The return code can be 0, a REXX socket API error number, or the REXX TCP/IP error number that is set by the socket command. The return code 0 indicates that the requested socket command was completed successfully.
See Socket call error return codes for additional information about the numeric error codes that are returned by this command.
The following REXX TCP/IP error numbers can be returned:- 9 EBADF
- 22 EINVAL
- 38 ENOTSOCK
- 45 EOPNOTSUPP
The following REXX socket API error numbers can be returned:- 2001 EINVALIDRXSOCKETCALL
- 2005 ESUBTASKNOTACTIVE
- 2009 ESOCKETNOTDEFINED
- 2012 EINVALIDNAME
LE C/C++ equivalent
long shutdown(int *s, int how);
Code example
See the EZARXS02 REXX sample in the SEZAINST file for an example
of using the SHUTDOWN command.