Class _Stdio._port

Inheritance graph
predef::_Stdio._port 7.8::Stdio.Port predef::Stdio.Port

Method create

_Stdio._port _Stdio._port(int|string port, void|function(:void) accept_callback, void|string ip)
_Stdio._port _Stdio._port("stdin", void|function(:void) accept_callback)

Description

When called with an int or any string except "stdin" as first argument, this function does the same as bind() would do with the same arguments.

When called with "stdin" as argument, a socket is created out of the file descriptor 0. This is only useful if that actually IS a socket to begin with, and is equivalent to creating a port and initializing it with listen_fd(0).

See also

bind, listen_fd