C API Reference -- Ns_SockListen

### Ns_SockListen

#### Overview

Create a socket on a specified address and port

#### Syntax

        SOCKET Ns_SockListen (
        char *host,
        int port
        );

#### Description

Ns_SockListen creates a socket listening for connections on the specified address and port.

#### Examples

        sock = Ns_SockListen("localhost", 25);
        while (1) {
           new = accept(sock, NULL, 0);
           ... communicate with client on new ...
        }

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