C API Reference -- Ns_SockTimedConnect

### Ns_SockTimedConnect

#### Overview

Create a remote socket within a specified time

#### Syntax

        SOCKET Ns_SockTimedConnect (
        char *host,
        int port,
        int timeout
        );

#### Description

Ns_SockTimedConnect creates a socket connected to a remote host and port, ensuring that the connection is established within the number of seconds specified by the `timeout` argument.

#### Examples

        sock = Ns_SockTimedConnect("mailhost", 25);
        if (sock == INVALID_SOCKET) {
           ... timeout or error connecting ...
        } else {
           ... use socket ...
        }

Top of Page
Copyright © 1998-99 America Online, Inc.