bluerhinos / phpMQTT

a simple php class to connect/publish/subscribe to a MQTT broker
Other
770 stars 461 forks source link

connect(): Inconsistent behavior across different brokers #13

Closed rparmar75 closed 4 years ago

rparmar75 commented 10 years ago

Ran into a connection problem while working with IBM MessageSight. Code that works with m2m.eclipse.org/iot.eclipse.org fails to connect with MessageSight. I tried several public brokers and was able to reproduce the error with dev.rabbitmq.com. Keep getting this for ever:

Connected to Broker eof receive going to reconnect for good measure Connected to Broker eof receive going to reconnect for good measure Connected to Broker eof receive going to reconnect for good measure Connected to Broker

Please try to connect with public broker dev.rabbitmq.com on 1883 and check.

macleetw commented 9 years ago

Try to modify "subscribe" function:

From: $cmd += ($qos << 1);

To: $cmd += (1 << 1);

MQTT v3.1 Chapter 3.8:

Subscribe message must have QOS 1 for itself in fix header.