Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] Paho Embedded-C - consider making cycle() public or protected.

Hi all,

In the current Paho embedded-C code, MQTT::Client::yield() will always take at least the specified time to return, regardless of whether there are any incoming messages or not.  It does this by calling Client::cycle() in a loop until the timer expires. Client::cycle() waits for and processes a single message and then returns to the caller.  

I have a situation where I’m expecting one message in response to data my app has published, so I’d like to be able to continue my code as soon as that message comes in.  Currently, even if that message is waiting for me when I call yield(), I still have to wait the full timeout period.

I would like to be able to call Client::cycle() from my own code, directly or in a child class so that I don’t have to wait the full yield() time.  Unfortunately, Client::cycle() is declared private, so I can’t do that.  Any chance cycle() could be made protected or public to give user applications more control over how long they have to wait for messages?

—
Joe





Back to the top