Saturday, May 25, 2024
Homepage · c#
 Popular · Latest · Hot · Upcoming
96
rated 0 times [  98] [ 2]  / answers: 1 / hits: 15569  / 12 Years ago, sat, march 31, 2012, 12:00:00

What is a good strategy for implementing long polling in a .Net application.



Would it mean having a JS setInterval() based approach to keep polling the server for updates that can be rendered on the page. I have always thought that that could be a challenge when it comes to scalability as it seems it would generate a lot of extra requests to the web server. I have read that this type of functionality should be implemented using a non blocking web server (single threaded) NODE.js etc...
Since there's only one thread/event loop it seems like the requests would have to be very lightweight to service several requests in a timely fashion. Can Node.Js trigger db calls?



I have seen an online dating site where you receive notification in the form of a fad-in/fade-out popup when someone visits your profile when you're currently logged into the system. I am impressed that something like that can work so well for a high volume site.



Is it reasonable to assume that this type of notification system is implemented using long polling? Based on constantly polling through JS?



I am seeing similar behind the scenes updates her on the SO site as well (messages/votes etc) Does this use a similar strategy as well?


More From » c#

 Answers
4

Realtime web applications have been with us for quite some time now:
the history of Polling goes from setInterval Technique to HTML5 WebSockets.



Here you can find Simple Long Polling Example with JavaScript.



http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery


[#86492] Friday, March 30, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
elliem

Total Points: 415
Total Questions: 117
Total Answers: 94

Location: American Samoa
Member since Fri, Aug 26, 2022
2 Years ago
;