Re: php websocket server and clients

From: Date: Tue, 19 May 2015 07:56:16 +0000
Subject: Re: php websocket server and clients
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-324912@lists.php.net to get a copy of this message
On Wed, May 13, 2015 at 10:25 PM, Marco Perone <m.perone@mvlabs.it> wrote: > Hi all, > > I'm trying to build a script that creates a websocket server and some > clients that connects to it. > > A huge synthesis of the code could be: > > |$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"); > }| > > > Would you kindly share more code? > > everything is fine for the first 35 clients, then the connections start to > slow down and they happen almost one per second. > > What is the reason for these delays? Is it a configuration setting? > Something due to my operative system? > > I'm using PHP 5.6.4-4 on ubuntu 15.04 > > Thanks! > -- Marcos | I love PHP, Linux, and Java <http://javadevnotes.com/java-integer-to-fixed-length-string>

« previous php.general (#324912) next »