i am trying to make a websocket server in my wordpress plugin.
when i try to access the site it loads alot of time and outputs this iis error:
The FastCGI process exceeded configured request timeout
websocket server code:
$loop = React\EventLoop\Factory::create();
$socket = new React\Socket\Server('127.0.0.1:9000', $loop);
$socket->on('connection', function (ConnectionInterface $conn) {
$conn->write("Hello " . $conn->getRemoteAddress() . "!\n");
$conn->on('data', function ($data) use ($conn) {
$conn->close();
});
});
$loop->run();
when i remove this code ^ it load fast and no error.
versions:
PHP: 7.2
ReactPHP: ^1.0
Wordpress: 4.9.2