note 89133 added to function.socket-read
| From: | t33th4n at gmail dot com | Date: | Mon, 23 Feb 2009 20:53:24 +0000 |
| Subject: | note 89133 added to function.socket-read | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-151029@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:
$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.
----
Server IP: 62.112.195.86
Probable Submitter: 89.132.86.214
----
Manual Page -- http://www.php.net/manual/en/function.socket-read.php
Edit -- https://master.php.net/note/edit/89133
Del: integrated -- https://master.php.net/note/delete/89133/integrated
Del: useless -- https://master.php.net/note/delete/89133/useless
Del: bad code -- https://master.php.net/note/delete/89133/bad+code
Del: spam -- https://master.php.net/note/delete/89133/spam
Del: non-english -- https://master.php.net/note/delete/89133/non-english
Del: in docs -- https://master.php.net/note/delete/89133/in+docs
Del: other reasons-- https://master.php.net/note/delete/89133
Reject -- https://master.php.net/note/reject/89133
Search -- https://master.php.net/manage/user-notes.php