Method SSL.Port()->bind()


Method bind

int bind(int port, function(mixed|void:int)|void callback, string|void ip, int|void reuse_port)

Description

Bind an SSL port.

Parameter port

Port number to bind.

Parameter callback

Callback to call when an SSL connection has been negotiated.

The callback is called with the _id as the argument. The new SSL.File is then typically retrieved by calling accept().

If the callback is 0 (zero), then connections will not be accepted until the first call of accept(), or a callback has been installed with set_accept_callback().

Parameter ip

Optional IP-number to bind.

Parameter reuse_port

If true, enable SO_REUSEPORT if the OS supports it.

Returns

Returns 1 if binding of the port succeeded, and 0 (zero) on failure.

See also

Stdio.Port()->bind(), File()->set_accept_callback(), listen_fd()