|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-02-23 08:40 UTC] mike_harris02135 at yahoo dot com
[2005-02-23 09:06 UTC] sniper@php.net
[2005-02-23 19:20 UTC] mike_harris02135 at yahoo dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 08:00:01 2025 UTC |
Description: ------------ Ive been on the forums and noone seems to be able to help with this. Im writing a jabber client with php. I connect to the server, send a message, sleep for 20 seconds (kill the server during this time), then send another message, and the code used to send the message does not report any error. Reproduce code: --------------- function WriteToSocket($data) { echo "\nIn WriteToSocket: $data\n"; echo "-------------Socket = " . $this->socket . "\n"; if(socket_last_error($this->socket)) { print "Detected error\n"; echo socket_strerror(socket_clear_error($this->socket)); } return socket_write($this->socket, $data, strlen($data)); } Expected result: ---------------- i expect socket_last_error to report that the socket was closed unexpectedly. Incidently, when I create the socket i always get an error with unknown error code, but the server receives the message just fine. Or the socket_write method would return 0, or the socket reference would be null. Actual result: -------------- The code does not indicate any error, and reports that n bytes were written.