mqtt
mqtt copied to clipboard
the new v2.0 can not use in product env
In the high load env, the v2.0 often report the following error: fwrite(): send of 2 bytes failed with errno=32 Broken pipe file:
but the old v1.0 can work well Basically.
How to reproduce and where this fwrite error occurs ?
PHP Notice: fwrite(): send of 2 bytes failed with errno=32 Broken pipe in /var/www/html/phalconapi/app/library/mqtt/SocketClient.php on line 166
code:
$cpush = new MQTT('tcp://'.$config->host.':'.$config->port.'/', $pclientid);
$context = stream_context_create();
$cpush->setSocketContext($context);
$cpush->setVersion(MQTT::VERSION_3_1_1);
$cpush->setKeepalive(60);
$cpush->setConnectClean(true);
$connected = $cpush->connect();
$cpush->setRetryTimeout(5);
$myhandler = new \MyPublishHandler();
$pushed = $cpush->publish_async($json->Subject, $content, $config->qos, $config->retain,$msgid);
$myhandler->waitQueue[$pushed['msgid']] = $pushed;
$cpush->setHandler($myhandler);
$cpush->loop();
and often throw new Exception('WTFFFFFF!!!! '); too. in MQTT.php 1285行.
Hi guys,
i also get thrown at the wtf exception in MQTT.php; i seems it depends on message specific content char combination being sent on publish (i am using qos2 async) i pass alot of ESC chars in there and on specific conditions, exception fires up.. i doesnt seem to be affected by overall payload length / "size".. can reproduce but cannot debug for sure !
@nielsenaa please give me a copy of your message
Hello Sskaje!
want some other kind of message that doesn’t fire exception ?
Thank you !
care to chat ? @nielsenaa on skype