Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reverse Ajax(Comet) with ASP.NET

I am looking for a basic example of how to implement the Reverse Ajax (Comet) with ASP.NET. I have already looked the below ones and I don't want to use them right now (because they are paid)

http://www.frozenmountain.com/websync/ http://www.lightstreamer.com/demos.htm

I have already gone on various links mentioned on SO . But most of them are pointing towards external API. I am looking for a clear cut example of how to implement that .

like image 815
Rocky Singh Avatar asked Dec 05 '22 23:12

Rocky Singh


2 Answers

Unfortunately you will not find one. Reverse Ajax is a complex task that requires both server side and client side "magic" in order to be cross-browser compatible, have proper state and thread management and be scalable. Essentially a comet server is a streaming connection per client (or long polling) + clever thread management. In addition for a proper comet server you would have to fully implement the Bayeux protocol.

There is an article on CodeProject on how you can implement something like that in IIS, but even that is immensely complex.

We've considered implementing something of our own but quickly decided against that, since that would cost us months of work, so those products come out really cheap.

Also, if you are really interested on how to implement something like that the best place to start would be to dig into WebSync source code, since it's not obfuscated. Be careful with plagiarism though as they have quite a few unique know-hows in there.

Another option is to consider other platforms (open source comet servers in other languages). You may find them to be a lot more suitable for the task than C#. For instance, you will find writing a comet server in erlang to be dead easy.

EDIT: There are actually already two great similar questions on SO that might help you: Comet implementation for ASP.NET? and Simple “Long Polling” example code?

like image 185
Egor Pavlikhin Avatar answered Dec 09 '22 15:12

Egor Pavlikhin


have a look at http://pokein.codeplex.com/

like image 36
Surya Avatar answered Dec 09 '22 14:12

Surya