Table of Contents

# $EPIC: listen.txt,v 1.3 2006/08/29 18:22:56 sthalik Exp $

Synopsis:

$listen()
$listen(<port> [family])

Technical:

Practical:

If you want your script to act as an Internet server, the $listen() function lets you establish a place where others can $connect() to you. Once they $connect() to you, you are given a small integer that acts in the same way that $connect() return values do.

Returns:

The port number being listened on, or the empty string on error.

Examples:

$listen(1025)             returns 1025
$listen(1023)             error, returns nothing
$listen(0)                returns a system-allocated port number
$listen()                 returns a system-allocated port number

History:

This function first appeared in ircII-2.2pre3