note 76069 added to function.socket-read
| From: | ein at anti-logic dot com | Date: | Thu, 28 Jun 2007 18:32:58 +0000 |
| Subject: | note 76069 added to function.socket-read | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128060@lists.php.net to get a copy of this message | ||
the proper way to detect a closed connection is to check socket_last_error.
Connection reset by peer is 104 (either use socket_strerror or don't suppress errors for the
time being to find these out), sooo.
while($buffer=@socket_read($sock,512,PHP_NORMAL_READ)){
echo $buffer;
}
if(socket_last_error($sock) == 104) {
echo "Connection closed";
}
----
Server IP: 216.235.15.211
Probable Submitter: 204.112.176.136
----
Manual Page -- http://www.php.net/manual/en/function.socket-read.php
Edit -- https://master.php.net/note/edit/76069
Del: integrated -- https://master.php.net/note/delete/76069/integrated
Del: useless -- https://master.php.net/note/delete/76069/useless
Del: bad code -- https://master.php.net/note/delete/76069/bad+code
Del: spam -- https://master.php.net/note/delete/76069/spam
Del: non-english -- https://master.php.net/note/delete/76069/non-english
Del: in docs -- https://master.php.net/note/delete/76069/in+docs
Del: other reasons-- https://master.php.net/note/delete/76069
Reject -- https://master.php.net/note/reject/76069
Search -- https://master.php.net/manage/user-notes.php