Extracted from Pike v7.6 release 61 at 2005-12-30.
pike.ida.liu.se
[Top]
Stdio
Stdio.Port

Method Stdio.Port()->bind()


Method bind

int bind(int|string port, void|function accept_callback, void|string ip)

Description

Bind opens a socket and binds it to port number on the local machine. If the second argument is present, the socket is set to nonblocking and the callback funcition is called whenever something connects to it. The callback will receive the id for this port as argument. Bind returns 1 on success, and zero on failiure.

If the optional argument 'ip' is given, bind will try to bind to this ip name or number.

See also

accept