Project

General

Profile

Event loop without client session

Added by Shantanu Tushar almost 10 years ago

Hi, I am using Wt to build a something that lets me control my tiny home automation setup. Right now I have a Wt webserver that shows buttons to turn off/on devices from a browser.

However, even when there are no web clients connected, I still want my Wt server to do stuff like checking every sensor every 10 seconds, for example. However, I see that Wt signal/slot needs a browser session to work.

So, how can I use an event loop inside my Wt webserver irrespective of clients?

If that helps, this is the slot I wish to call every few seconds https://github.com/shaan7/automation/blob/07838ff4825d6ddebb872fe80923ac5b5cba8f44/radio.cpp#L113


Replies (1)

RE: Event loop without client session - Added by Wim Dumon almost 10 years ago

Hi,

WServer has a WIOService that can be used for this.

BR,

Wim.

    (1-1/1)