note 89133 modified in function.socket-read by danbrown

From: Date: Mon, 23 Feb 2009 20:57:26 +0000
Subject: note 89133 modified in function.socket-read by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-151030@lists.php.net to get a copy of this message
I don't know if is it stated anywhere with this clearance, but here is the source code for detecting the connection abort/closure for sockets testing with socket_read function: <?php $buf = @socket_read($routes[$i][$connectionid]['tunnelsrc'], $buffer_size); if ($buf === '') { $routes[$i][$connectionid]['disconnected']='Conenction abort at source side'; } ?> ($buf === '') is the key :) I was making an ecrypted tunnel script with mcrypt and was annoying that i could not detect the connection abort from any side. --was-- I don't know if is it stated anywhere with this clearance, but here is the source code for detecting the connection abort/closure for sockets testing with socket_read function: $buf = @socket_read($routes[$i][$connectionid]['tunnelsrc'], $buffer_size); if ($buf === '') { $routes[$i][$connectionid]['disconnected']='Conenction abort at source side'; } ($buf === '') is the key :) I was making an ecrypted tunnel script with mcrypt and was annoying that i could not detect the connection abort from any side. http://php.net/manual/en/function.socket-read.php

« previous php.notes (#151030) next »