Extracted from Pike v7.4 release 117 at 2004-11-02.
pike.ida.liu.se
[Top]
predef::
Stdio
Stdio.Port

Method Stdio.Port()->bind()


Method bind

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

Description

Bind opens a sockets 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 the socket. 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