I am trying to create a set of websocket clients with the following code:
$server = stream_socket_server("tcp://127.0.0.1:8080");
for ($i = 1; $i <= 50; $i++) {
var_dump($i);
stream_socket_client("tcp://127.0.0.1:8080");
}
The first 35, or so, connections are created very fast. Then everything slows down and every step takes 1 second to execute.
Could you explain to me why this behaviour happens? Is it caused by a configuration parameter? Is it a common websocket behaviour?