Closed hedgehed closed 4 years ago
I found the problem in the module norgul/xmpp-php/src/Socket.php uses fgets($this->connection) with a timeout of 1 second
here is solution idea https://stackoverflow.com/questions/9356152/non-blocking-on-stdin-in-php-cli
Hello @hedgehed
the slowness issue was already discussed here, and apparently timeout which is set to 1 in Socket.php
imposes a 1s timeout, not setting the max waiting period (which I initially thought).
You can speed it up by using a 250ms timeout instead (stream_set_timeout
third parameter is microseconds so you can pass 250000 there and use 0 as second parameter).
This is something I have started working on but am currently a bit busy so I can't. If you find a nice solution feel free to make a PR.
Thank you
Hello @hedgehed, I have made the improvements and published as new patch version. You can try it out. I am closing the issue as resolved. Thanks
Hi Hello My sequence of connecting and sending a message takes about 10 seconds, how can this be accelerated? My code is ` $logger = new Logger('xmpp'); $logger->pushHandler(new StreamHandler('php://stdout', Logger::DEBUG));
` launched on same server with ejabberd.
Thanks !