Implementing a server side push for a small number of clients
For an web application I am working on I开发者_高级运维 have the following requirements:
- Clients need to be able to log in via a web brower.
- After logging in, they will be able to
- change configurations (normal request/response)
- will be able to receive alarms sent by the server (a server side push)
Now, the question is how to implement the alarms. I first thought of using some long polling approach (Comet), but as the amount of clients will definitely belimited to 5-10, I'm now thinking to go with a simpler approach.
What are the options I have? Would it be okay to just let the clients poll the server?
5-10 clients? I would just have them poll the server. No need to over engineer this.
You could consider using an Adobe Flash object to open a socket connection to the server.
This would allow the client and server to actually be "connected", therefore letting you know on the server that you are indeed connected, or when the connection is lost.
You could also tie in a simple heartbeat system into this, allowing "readiness" verification every second or few.
As a side note... Are you sure a web app is the right platform for this, as opposed to a native GUI application?
精彩评论