[ Previous ] [ Contents ] [ Index ] [ Next ]

Ns_GetSockErrno

Overview

Get error number for socket connection

Syntax

    Ns_GetSockErrno(void);

Description

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.

Example

    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 ...
          }
       }
    }

See Also

Ns_ClearSockErrno

Ns_SetSockErrno

Ns_SockStrError

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1996 America Online, Inc.