Re: Re: php websocket server and clients
| From: | Marco Perone | Date: | Fri, 22 May 2015 11:45:22 +0000 |
| Subject: | Re: Re: php websocket server and clients | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-324938@lists.php.net to get a copy of this message | ||
I tried what you suggested
<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
$server = stream_socket_server("tcp://127.0.0.1:8080", $errno, $errstr);
for ($i = 1; $i <= 50; $i++) {
var_dump($i);
stream_socket_client("tcp://127.0.0.1:8080", $clerrno, $clerrstr);
var_dump($errno);
var_dump($errstr);
var_dump($clerrno);
var_dump($clerrstr);
}
but the error codes are always zero and the messages empty
On 21/05/2015 21:12, Christoph Becker wrote:
Marco Perone wrote:I modified my script to <?php error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 1); $server = stream_socket_server("tcp://127.0.0.1:8080"); for ($i = 1; $i <= 50; $i++) {No, that should be fine (you can double check, though, by addingvar_dump($i); stream_socket_client("tcp://127.0.0.1:8080"); //stream_socket_accept($server);} but it doesn't show any error. Am I doing something wrong it turning on error reporting?var_dump(error_reporting())). It's possible that the error message only shows up on Windows. Maybe you get some information if you specify the $errno and $errstr parameters to stream_socket_server() and stream_socket_client(), and print their values.