← All docs

stream_socket_accept()

Accept a connection on a socket created by stream_socket_server().

stream_socket_accept()

function stream_socket_accept(resource $socket, float $timeout = null, string $peer_name = null): mixed

Accept a connection on a socket created by stream_socket_server().

Parameters:

  • $socket (resource)
  • $timeout (float), default null, optional
  • $peer_name (string), passed by reference, default null, optional

Returns: mixed

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how stream_socket_accept is implemented in the compiler, see the internals page.