mqtt icon indicating copy to clipboard operation
mqtt copied to clipboard

the new v2.0 can not use in product env

Open w3yyb opened this issue 7 years ago • 8 comments

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.

w3yyb avatar Apr 12 '17 02:04 w3yyb

How to reproduce and where this fwrite error occurs ?

sskaje avatar Apr 12 '17 03:04 sskaje

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

w3yyb avatar Apr 12 '17 03:04 w3yyb

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();

w3yyb avatar Apr 12 '17 03:04 w3yyb

and often throw new Exception('WTFFFFFF!!!! '); too. in MQTT.php 1285行.

w3yyb avatar Apr 12 '17 03:04 w3yyb

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 avatar Jul 13 '17 02:07 nielsenaa

@nielsenaa please give me a copy of your message

sskaje avatar Jul 13 '17 02:07 sskaje

Hello Sskaje!

want some other kind of message that doesn’t fire exception ?

Thank you !

nielsenaa avatar Jul 13 '17 03:07 nielsenaa

care to chat ? @nielsenaa on skype

nielsenaa avatar Jul 13 '17 03:07 nielsenaa