Method SSL.Port()->listen_fd()


Method listen_fd

int listen_fd(int fd, function(mixed|void:int)|void callback)

Description

Set up listening for SSL connections on an already opened fd.

Parameter fd

File descriptor to listen on.

Parameter callback

Callback to call when the SSL connection has been negotiated.

The callback is called with an File as the first argument, and the id for the File as the second.

If the callback is 0 (zero), then negotiated Files will be enqueued for later retrieval with accept().

Returns

Returns 1 if listening on the fd succeeded, and 0 (zero) on failure.

See also

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