start page | rating of books | rating of authors | reviews | copyrights

Programming Perl

Programming PerlSearch this book
Previous: 3.2.19 closedir Chapter 3
Functions
Next: 3.2.21 cos
 

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 .


Previous: 3.2.19 closedir Programming Perl Next: 3.2.21 cos
3.2.19 closedir Book Index 3.2.21 cos