|
|
Get error number for socket connection
Ns_GetSockErrno(void);
Ns_GetSockErrno gets the current error number for the socket connection.
This function (along with the other error reporting functions listed below) is part of a platform-independent interface to the error reporting mechanisms on Unix. On Unix, the per-thread errno variable is used.
sock = Ns_SockConnect("mailhost", 25);
if (sock != INVALID_SOCKET) {
Ns_SockSetNonBlocking(sock);
while (1) {
nsent = send(sock, buf, buflen, 0);
if (nsent < 0 && Ns_GetSockErrno() == WSAEWOULDBLOCK) {
... send would block - do something else ...
}
}
}