User`s guide

196
K
A
DAK
KwikNet TCP/IP Sockets
kn_close kn_close
Purpose Close a Socket
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_close(int s);
Description S is a socket descriptor identifying the socket to be closed.
When a socket is closed, associated naming information and queued
data are discarded.
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.
EALREADY The socket is already in the process of closing.
ETIMEDOUT The socket's linger option was enabled with a
non-zero timeout value. The linger timeout expired
before the TCP close handshake with the remote host
could be completed (blocking TCP socket only).
See Also kn_socket()