Extracted from as of .
   

Method Stdio.Port()->create()


Method create

void Stdio.Port()
void Stdio.Port(int|string port)
void Stdio.Port(int|string port, function(:void) accept_callback)
void Stdio.Port(int|string port, function(:void) accept_callback, string ip)
void Stdio.Port("stdin")
void Stdio.Port("stdin", function(:void) accept_callback)

Description

If the first argument is other than "stdin" the arguments will be passed to bind().

When create is called with "stdin" as the first argument, a socket is created out of the file descriptor 0. This is only useful if it actually is a socket to begin with.

See also

bind


Method create

void Stdio.Port(int|string port, void|function(:void) accept_callback, void|string ip)
void 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.

See also

bind, listen_fd