From the manual:
The maximum number passed to the backlog parameter highly depends on
the underlying platform. On Linux, it is silently truncated to
SOMAXCONN. On win32, if passed SOMAXCONN, the underlying service
provider responsible for the socket will set the backlog to a maximum
reasonable value. There is no standard provision to find out the
actual backlog value on this platform.
Hell, what if I still want to limit connections myself? Limiting connections like:
if( count($client_sockets) < $max_clients ) {
//accept connection
} else {
echo "Limit reached!";
}
will not work well in combination with socket_select()
, because function still got incoming connection, that server needs to handle properly! Accepting connection > $max_clients
and than closing it right away is not an option, so... Maybe anyone knows how to do it?