Reverse Ajax (Comet) with ASP.NET

I am looking for a basic example of how to implement inverse Ajax (comet) with ASP.NET. I already looked below and I do not want to use them right now (because they are paid)

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

I already mentioned the various links mentioned on SO. But most of them point to an external API. I am looking for a clear example of how to implement this.

+4
source share
5 answers

Unfortunately, you will not find it. Reverse Ajax is a complex task requiring server and client magic to be compatible with multiple browsers, to have proper state and flow control, and to be scalable. In fact, the comet server is a streaming connection per client (or a long poll) + smart flow control. In addition, for a proper comet server, you need to fully implement the Bayeux protocol .

There is an article on CodeProject on how you can implement something similar in IIS, but even this is very complicated.

We considered the possibility of introducing something of our own, but quickly decided that it would cost us months of work, so these products come out really cheaply.

Also, if you're really curious about how to implement something like this, the best place to start would be to dig out the WebSync source code, as it hasn't gotten tangled. Be careful with plagiarism, although they have a lot of unique know-how.

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

EDIT: Actually, there are two big, similar questions about SO that might help you: Implementing a comet for ASP.NET? and a simple example of a "long survey"?

+9
source
+4
source

Take a look at SignalR, it's free, very easy to use, and works well.

https://github.com/SignalR/SignalR

Scott Hanselm talks about this in his blog too
+2
source

I searched the same thing and I found https://github.com/nmosafi/aspComet , which is open source (you can do your part if you want), They have a working sample on the site that you can look at . They have a guy who blogs about some design decisions, etc. that you might find useful ( Link to Blog )

+1
source

See this SO question if you want to consider Silverlight PollingDuplexHttpBinding as a way to link Javascript to your server.

0
source

Source: https://habr.com/ru/post/1335816/


All Articles