Closed Kreatous closed 4 years ago
Try setting an on error listener on the socket, that should give you an idea if there are issues on that side
i have added an error exception listener but still nothing no error output even php logs are not showing anything
$loop = React\EventLoop\Factory::create();
$socket = new React\Socket\Server(sprintf('0.0.0.0:%s', $this->port), $loop);
$socket->on('connection', function (React\Socket\ConnectionInterface $connection) use ($loop) {
$connection->on('data', function ($data) use ($connection, $loop) {
}, function (Exception $error) {
var_dump($error);
});
}, function (Exception $error) {
var_dump($error);
});
$loop->run();
Thank You @WyriHaximus for your response the problem was with max_execution_time
it was limited to 120 seconds so the script always stopped adding set_time_limit(0);
or ini_set('max_execution_time', '0');
fixes the issue
Thank you once again :)
I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can reopen this :+1:
I have a simple socket server
$loop = React\EventLoop\Factory::create(); $socket = new React\Socket\Server(sprintf('127.0.0.1:%s', $this->port), $loop); $socket->on('connection', function (React\Socket\ConnectionInterface $connection) use ($loop, $socket, $conn) { $connection->on('data', function ($data) use ($connection, $loop, $socket) { }); }, function (Exception $error) { var_dump($error); }); $loop->run();
after about a 5 minute idle time if i try to connect to it, then it connects for a second and disconnects the socket server is there any socket timeout or a way to keep it running in an infinite loop