bluerhinos / phpMQTT

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

Problem with phpMQTT publish or subscribe #5

Closed piousdeepakxavier closed 9 years ago

piousdeepakxavier commented 11 years ago

Im running mosquitto mqtt broker in my machine. If I subscribe with java client and publish by phpMQTT its working well. however if i publish and subscribe with phpMQTT, im not able to subscribe. Could you plz help me what is wrong with my pub/sub.

bluerhinos commented 11 years ago

How are you subscribing with php, is it via a webserver, because subscripting requires you the client to wait in a loop, I designed the subscribe bit to run in a loop as a background script, not for webrequests, you may be able to engineer something with retained messages, and disconnection as soon as messaged received.

What are you trying to achieve and do you have any code examples.

namjitharavind commented 7 years ago

Same problem for me. Please help.