# Method SSL.sslport()->listen_fd()

Method listen_fd

  ``int` listen_fd(`int` `fd`, `function`(`SSL.sslfile`|`void`, `mixed`|`void`:`int`) `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 SSL.sslfile as the first argument, and the id for the SSL.sslfile as the second.

  If the `callback` is `0` (zero), then negotiated SSL.sslfiles 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()`, SSL.sslfile()->set_accept_callback(), bind()