User`s guide

220
K
A
DAK
KwikNet TCP/IP Sockets
kn_shutdown kn_shutdown
Purpose Shut down All or Part of a Full Duplex Socket Connection
Used by
n Task o ISP o Timer Procedure o Restart Procedure o Exit Procedure
Setup Prototype is in file KN_SOCK.H.
#include "KN_SOCK.H"
int kn_shutdown(int s, int how);
Description S is a socket descriptor identifying the socket with the connection which is
to be shut down.
How is an integer which defines how the connection is to be adjusted.
0 if no further receives are allowed
1 if no further sends are allowed
2 if no further receives or sends are allowed
Returns If successful, a value of 0 is returned.
On failure, the error status -1 is returned.
The error indicator for socket s is set to define the reason for failure. Use
kn_errno() to retrieve the error code.
EBADF The socket descriptor s is invalid.
EINVAL Parameter how is invalid.
ESHUTDOWN The connection has been shut down or
the socket is in the process of closing.
EOPNOTSUPP Invalid operation (not a TCP socket).
Restriction This procedure can only be used to shut down a socket which supports the
TCP protocol.
See Also kn_accept(), kn_connect(), kn_socket()