Re: [mqtt] Non-Blocking Subscription

165 views
Skip to first unread message

Nicholas O'Leary

unread,
Aug 23, 2012, 8:47:46 AM8/23/12
to mq...@googlegroups.com
Hi Ben,

I've never used the PHP SAM client, so I don't have first-hand
experience if this is possible.

That said, the sample code for a subscriber on the wiki -
http://mqtt.org/wiki/doku.php/php_sam - at first glance appears to
offer what you are after.

Regards,
Nick

On 22 August 2012 02:23, Ben Hornshaw <bhor...@prg.com> wrote:
> Hi
>
> Im new to all this and im trying to implement MQTT into my php program.
> the php file i run in the CLI is a constantly looping using a while(1).
> I would like to check for any messages that have arrived on the specified
> topics each time the while loop runs not block on the $conn=>received in SAM
> or $mqtt->proc() in phpMQTT waiting for one as this causes the loop to stop
> and possibly MQTT messages wont be received for hours.
>
> Is this possible??
>
> Thanks
> Ben
>
> --
> --
> To learn more about MQTT please visit http://mqtt.org
>
> To post to this group, send email to mq...@googlegroups.com
> To unsubscribe from this group, send email to
> mqtt+uns...@googlegroups.com
>
> For more options, visit this group at
> http://groups.google.com/group/mqtt
>
>
>

Ben Hornshaw

unread,
Aug 28, 2012, 5:47:16 PM8/28/12
to mq...@googlegroups.com
Hi Nick

Thanks for your reply

Apologies. i didn't quite mean just using SAM. It was more of a general question. If i am honest i would prefer to use your the phpMQTT Class as if offers more features.
I was more asking a general how would you suggest i do this question?

Thanks

Ben
Reply all
Reply to author
Forward
0 new messages