Reputation: 3058
I am trying to develop a comet page using Asp.net. Surfed a lot and found some plugins like Pokein. I feel this blog, to be best suited for my project as it goes in hand with jQuery. But this is in MVC. I wonder if i can do the same with ASP.NET website pages.
All i need to do is to free up the worker process during the long waiting ajax-call duration. In MVC, async controllers come handy.
Could someone help me if I can do the same with website pages(say: free up the worker process during the long waiting jquery Ajax call inside the static web method).
I read about async pages in websites here, but this will take a full posback and the page is blocked during the long wait. (basically free up worker process during pre-render and wait for long polling, but the UI still keeps refreshing as the page life cycle is not completed)
Thanks in advance for your advice geeks...
Upvotes: 3
Views: 480
Reputation: 21304
'Push' style architectures on the web using purely ASP.NET, JavaScript, JQuery, AJAX etc. can be difficult and involved to implement. Normally the route most go is more of a glorified 'pull' model where a timer somewhere client side will check back to the server for the needed data or state required and then preform the necessary action. If you truly want a more of a push architecture with purely web technologies, you will want to look into the long polling 'Comet' architecture. You can read more about it below:
Comet (programming):
http://en.wikipedia.org/wiki/Comet_(programming))
Ideally in the Microsoft world if possible you could jump over to a rich client technology like Silverlight to work with a duplex polling WCF service in which a client subscribed to the server can get updates pushed from the server back to the client. Anytime (as of today)I would need to implement any type of 'push' architecture today I would personally opt for Silverlight as there are numerous examples on how to implement this easily. If you are interested take a look to the (2) links below:
Pushing Data to a Silverlight Client with a WCF Duplex Service:
http://weblogs.asp.net/dwahlin/archive/2008/06/16/pushing-data-to-a-silverlight-client-with-wcf-duplex-service-part-i.aspx
How to: Build a Duplex Service for a Silverlight Client:
http://msdn.microsoft.com/en-us/library/cc645027(VS.95).aspx
Regardless, COMET/Silverlight/Flash, etc. are probably not going to be a widely used option going forward anyways with web sockets in HTML5. But since the spec is not quite ready (see: http://ishtml5readyyet.com/) you might needs to look at using a Silverlight control on your ASP.NET page in the meantime and it will work well.
Upvotes: 1