Reputation: 10222
I'm working on a project where a page, needs to be able to keep updated according to the state of a server.
I like websockets for this since they offer me a way of pushing messages from the server, but availability is a problem.
I need generic way to do two way communication between a webserver and a browser-client.
I would like to be able to hold a large amount of clients on my server, so busywaiting clients is not a good solution.
I've looked at long pooling, but this seames like busy waiting on the clients part -- is it the only way to go if I need IE support?
This question is only about the clients end of the transactions.
Upvotes: 0
Views: 922
Reputation: 11
Yes, you are correct there is a problem with longpolling, it tends to consume loads of resources.
What you need is as i can see solution that has a fallback to HTTP longopolling for elder not Websockets API speaking browsers. SSE is a alternvative,but Websockets feels as a more convinent
If you are running on the .NET plattform XSockets.NET can be a alternative, it supports Websockets (RFC6544 and Hybi00) and fallbacks on HTTP Longpolling when needed (i.e IE )
Have a look at http://xsockets.net
Upvotes: 1
Reputation: 2880
Do you need two-way communication? If not you should use SSE (Server-sent Events). They are also easier to simulate in IE (as SSE actually degrades gracefully to long-polling on older systems).
Upvotes: 1
Reputation: 3221
Have you reviewed http://signalr.net/ ? Based on websockets but will gracefully downgrade to the nearest available component to support a socket type connection.
Docs can be found here: https://github.com/SignalR/SignalR/wiki
Upvotes: 0