I am working on a little project that I want to implement long polling
in. I do not want to use SignalR or any other third-party libraries for this. I have a ASP.NET WebForm
that I implement a simple web method, exposed through the asp.net page (decorated with the [WebMethod] attribute).
This is a very simple project and only this single method needs to be used in an async fashion so it isn't using threads from the request pool. I'm not interested in third-party libraries that accomplish this, MVC Async Controllers, entire Async Webform page, etc... I am just looking for a simple implementation to get this to work on a single method that will be requested via AJAX requests from the client.
So far I'm not sure how to approach it as most of the resources I have found out-right implement async for the entire project, which is NOT what I want.
Anyone have any ideas or resources on how I can accomplish this small thing?
There is an MSDN Sample that uses the ManualResetEvent class, a script manager control, and a webservice to implement long polling (they call it reverse ajax in the sample).
http://code.msdn.microsoft.com/CSASPNETReverseAJAX-7a1f0c2b
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With