Re: Re: php websocket server and clients

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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++) {
     var_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?
No, that should be fine (you can double check, though, by adding
`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.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux