sskaje / mqtt

MQTT Client class
https://sskaje.me/category/MQTT/
MIT License
86 stars 33 forks source link

message_read throw Exception #28

Open txc1133 opened 5 years ago

txc1133 commented 5 years ago

Hi

I use multiple clients to subscribe to the same channel. Sometimes, some clients catch this Exception, some works just fine. Could you help me to explain why this happens and how can I deal with this?

[2019-02-14 02:49:46.236260] INFO   loop(): received PUBLISH
[2019-02-14 02:49:46.236296] DEBUG  loop(): PUBLISH QoS=0 PASS
I got a message:(msgid=0, QoS=0, dup=0, topic=status, command=GRADE_HOSE_TANK) {"command":"GRADE_HOSE_TANK","status":"OK","stationId":212,"dispenserNum":5,"hoseNum":0,"gradeNum":12,"tankNum":5}
[2019-02-14 02:49:46.280716] DEBUG  socket_connect()
[2019-02-14 02:49:46.280782] DEBUG  socket_connect(): connect to={my url}
[2019-02-14 02:49:46.471183] INFO   connect(): Connection established.
[2019-02-14 02:49:46.471316] DEBUG  SOCKET: blocking mode: ON
[2019-02-14 02:49:46.471409] DEBUG  connect(): clientid={clientId}
[2019-02-14 02:49:46.471459] DEBUG  connect(): keepalive=60
[2019-02-14 02:49:46.471496] DEBUG  connect(): username={my username} password={my password}
[2019-02-14 02:49:46.471544] DEBUG  Message write: message_type=CONNECT
[2019-02-14 02:49:46.471731] DEBUG  Message Build: total length=59
[2019-02-14 02:49:46.472173] DEBUG  socket_write(length=59)
DUMP    10 39 00 06 4d 51 49 73 64 70 03 c2 00 3c 00 14     .9..MQIsdp...<..
DUMP    6d 71 74 74 39 33 33 39 36 64 64 37 38 37 35 39     mqtt93396dd78759
DUMP    63 31 31 37 00 05 73 61 76 65 6f 00 0e 65 64 67     c117..saveo..edg
DUMP    65 2d 77 6f 72 6b 73 2e 6e 65 74                    e-works.net     

[2019-02-14 02:49:46.472319] DEBUG  connect(): bytes written=59
[2019-02-14 02:49:46.472367] DEBUG  socket_read(2)

Fatal error: Uncaught exception 'sskaje\mqtt\Exception' with message 'WTFFFFFF!!!! ' in /var/www/html/api/library/mqtt/mqtt/MQTT.php on line 1275

sskaje\mqtt\Exception: WTFFFFFF!!!!  in /var/www/html/api/library/mqtt/mqtt/MQTT.php on line 1275

Call Stack:
    0.0003     243288   1. {main}() /var/www/html/api/app/cli.php:0
    0.0007     257488   2. Phalcon\Cli\Console->handle() /var/www/html/api/app/cli.php:69
    0.0008     261960   3. Phalcon\Dispatcher->dispatch() /var/www/html/api/app/cli.php:69