SockShutDown

The SockShutDown() call shuts down all, or part, of a full duplex connection. This call is optional.

Syntax:

>>--SockShutDown(socket, howto)------------------------------------------><

>where:

socket

is the socket descriptor.

howto

is the condition of the shutdown of socket.

Because data flows in different directions are independent of each other, SockShutDown() allows you to independently stop data flows in one direction, or all data flows, with one API call. For example, you can enable yourself to send data but disable other senders to send data to you.

The howto parameter sets the condition for shutting down the connection to socket socket. It can be set to one of the following:

0

No more data can be received on socket.

1

No more output is allowed on socket.

2

No more data can be sent or received on socket.

Return values:

The value 0 indicates successful execution of the call. The value -1 indicates an error. You can get the specific error code SockSock_Errno() or SockPSock_Errno(). Possible values are:

ENOTSOCK

socket is not a valid socket descriptor.

EINVAL

howto was not set to a valid value.

Note: SockShutDown() interfaces with the C function shutdown().