ID: 32075 Updated by: [EMAIL PROTECTED] Reported By: mike_harris02135 at yahoo dot com -Status: Open +Status: Bogus Bug Type: Sockets related Operating System: linux PHP Version: 4.3.10 New Comment:
First you need to fix the obvious errors in your script. Like echo socket_strerror(socket_clear_error($this->socket)); And such. (socket_clear_error() does not return anything) Then if you still can't get it to work, ask further support questions on how to use PHP and how to use sockets on the mailing lists. No bug here. Previous Comments: ------------------------------------------------------------------------ [2005-02-23 08:40:01] mike_harris02135 at yahoo dot com incidently, I also tried using the fsockopen method and fread and fwrite, and that did not detect an error either... ------------------------------------------------------------------------ [2005-02-23 08:35:51] mike_harris02135 at yahoo dot com 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32075&edit=1