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

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.

Example

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

Top of Page

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