bluerhinos / phpMQTT

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

How to receive messages #55

Closed chcmq closed 4 years ago

chcmq commented 6 years ago

How do you receive the returned message after you send it?

markus-hsk commented 6 years ago

You can subscripe to the same topic before you publish. And so you receive it shortly after you sent it. I did this in my application to be 100% sure, that it was really transferred to the broker.

chcmq commented 6 years ago

What functions should I use if I were to receive the phpMQTT class?

bluerhinos commented 4 years ago

Canned Response: Subscribe is not designed for web requests, it should be used in a long running process. I do plan to add a subscribeAndWaitForMessage() function #95