Using long polling with WinForms Clients in .NET
We need to develop a .NET application, basically a WinForms client, which needs to be notified of changes only from the server to update the UI only in case of necessity and not every time.
We initially thought of NetTCPBinding but understood that it has problems with firewalls across domains and secure networks. We now consider long-polling as a viable option but we could only find this being used with WPF and XAML clients.
开发者_JS百科For example, http://code.msdn.microsoft.com/duplexhttp
But we could not find anything with WinForms. My opinion is that long-polling has to do with WCF and does not matter what UI technology is used (within .NET).
Do you think it is possible to use long-polling with a custom WCF channel for WinForms?
I am on the way to develop a POC but dont have much time. Any help in the right direction is much appreciated.
Thanks much Charles
You could also check out WebSync (www.frozenmountain.com/websync) which is a comet server for IIS/.NET. It has a WinForms client too, so it should work nicely for you. And since its all standard HTTP traffic, it should help you avoid issues with firewalls, etc.
You are correct about WCF, it's platform-agnostic (WinForms, WPF, etc.). As long as your server exposes or can be made to expose an endpoint, WCF or standard WS, you should be all set.
P.S. If you're in a rush, I would advise to code the web service on your server, then use Visual Studio to create the proxies for you, to get you up and running quickly. On the project, do "Add service reference".
try this :) http://idunno.org/archive/2008/05/29/wcf-callbacks-a-beginners-guide.aspx
精彩评论