[Chapter 3] 3.2.20 connect
Author: Larry Wall, Tom Christiansen & Randal L. Schwartz
Date: 1999-07-02T01:48:04Z

#

| Chapter 3 Functions |

### 3.2.20 connect

    connect SOCKET, NAME

This function does the same thing as the connect system call - see connect(2). The function initiates a connection with another process that is waiting at an accept(2). The function returns true if it succeeded, false otherwise (and puts the error code into $!). `NAME` should be a packed network address of the proper type for the socket. For example:

    connect S, $destadd
        or die "Can't connect to $hostname: $!\n";

To disconnect a socket, either close or shutdown. See also the example in the section "Sockets" in Chapter 6.

3.2.19 closedir |  | 3.2.21 cos