views:

73

answers:

4

I keep getting comet when I search for this, but comet seems to complex for my needs, i.e. 100 users max with probably 10 users online at a time.

Is there are better solution for my requirements, i.e. be able to push data to clients, probably between 10-20 clients max at a time.

+1  A: 

No there isn't. When you take into consideration all the issues regarding NAT traversal, Firewalls and client side security restrictions, the only solution left is to have the client initiate the HTTP request and wait for a response that will 'push' back the data. Ie. Comet.

Remus Rusanu
We have an IIS server for our .net powered intranet. can comet be implemented on that or does comet need it's own independent server?
oshirowanen
'Comet' is an umbrella term covering many technologies. The long-poll can be implemented on any platform. There is no such thing as a 'comet server'.
Remus Rusanu
true, but IIS doesn't scale very well. i would try to use Nginx (http://en.wikipedia.org/wiki/Nginx) instead.
Mouhannad
One must use Async handlers: http://stackoverflow.com/questions/1756576/is-comet-easier-in-asp-net-with-asynchronous-pages/1756622#1756622
Remus Rusanu
A: 

you can use a short polling approach where the client requests new data e.g. every second, and then the server sends data back whenever there is any. The client needs to store the id or timespan of the last updated data and then keep asking the server if there is anything newer than that.

Since you said you don't have many users, I think this approach is the simplest and easiest to implement.

Mouhannad
+2  A: 

I also think Comet/bayeux might be a little too complex, but simple long-polling should get the job done.

You could use get_lock as some sort of blocking wait.

Alfred
Do you know of any ajax long polling tutorials?
oshirowanen
Stackoverflow.com already has a topic explaining simple long-polling:http://stackoverflow.com/questions/333664/simple-long-polling-example-code
Alfred
A: 

If you're not married to Internet Explorer, there's at least one .NET implementation of a WebSockets server out there. That will handle Webkit browsers (Chrome and Safari) and Firefox 4, but leave IE users stranded, or at least restricted to pull technology (AJAX/AJAJ).

Stan Rogers