Added NODELAY option to both server and client
This commit is contained in:
@@ -142,6 +142,7 @@ class IPSocket extends Socket
|
||||
{
|
||||
throw new Exception("Error creating socket: ".socket_last_error()." ".socket_strerror(socket_last_error()));
|
||||
}
|
||||
//socket_set_option($this->sock, SOL_TCP, TCP_NODELAY, 1);
|
||||
$this->connected = false;
|
||||
$this->host = $ip;
|
||||
$this->port = $port;
|
||||
|
||||
@@ -36,9 +36,10 @@ function testSocket($amount, $reconnect, $size)
|
||||
$m = makeRequest($size);
|
||||
logTime("begin sending");
|
||||
$s->sendMessage($m);
|
||||
$ts = hrtime(true);
|
||||
logTime("sent, receiving");
|
||||
$r = $s->receiveMessage();
|
||||
logTime("received");
|
||||
logTime("received, time = ".sprintf("%.3f", (hrtime(true) - $ts) / 1000000.0));
|
||||
$current++;
|
||||
if ($current >= $reconnect)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user