I have an HTML page that needs to monitor my plugin for events. What I want to do is have the web page connect to my plugin using AbstractFeaturePage.RegisterRequestCallback(). The idea is that the registered callback function receives the request and sits on it until some event occurs. I have this working really well if I create my own listening socket bound to some random port but to properly manage firewalls and such I would rather use HomeSeer as it binds to port 80.
Unfortunately a RegisterRequestCallback() registered callback can only sit on one HTTP connection request at a time. Is there any way to tell HomeSeer to async process such HTTP requests so that I can queue them up and return results when my code is ready to do so?
The only other options I have is to either:
Unfortunately a RegisterRequestCallback() registered callback can only sit on one HTTP connection request at a time. Is there any way to tell HomeSeer to async process such HTTP requests so that I can queue them up and return results when my code is ready to do so?
The only other options I have is to either:
- Client constantly polls the plugin:
My registered callback function simply returns immediately with some flag indicating whether a change as been detected (that the client responds to). This is what I am currently doing but a call every second puts an undue load on the HomeSeer and is not scalable. - Plugin binds to random TCP port:
I did this and it works really well but makes it difficult to penetrate firewalls and such.
Comment