开发者

Windows App that talks to Windows Service in C#?

开发者 https://www.devze.com 2023-01-29 07:11 出处:网络
This is a general question that has come up for debate.What do you recommend we use to enable a Winforms client to talk to a Windows Service.Our scenario is this:We have a Windows Service (C# .Net Fra

This is a general question that has come up for debate. What do you recommend we use to enable a Winforms client to talk to a Windows Service. Our scenario is this: We have a Windows Service (C# .Net Framework 4.0) that imports lots of different data into a database in batches.

The windows client would enable the user to monitor batch progress in real-time, re-start batches, and do other simple configuration tasks.

I'm interested in a little friendly debate over which technologies/approaches to use and why. Socket connections, remoting, WCF, whatever you have used in the past.

If anybody has a link to a working sample, that would be wonderful.

There are lots of problems to consider here... thr开发者_JS百科eading, network distance and performance, etc... Ideally I'd like this to work tolerably well over a VPN connection, but it isn't a strict requirement.

Thanks!


1) Sockets: Too low level

2) Remoting: Superseded by WCF

3) WCF: The standard approach using TCP binding

4) Indirect through config file or database: Is worth considering so that both client and server will communicate to a database and can send messages using that. Depends on the scenario.

WPN? Well VPN is supposed to get everything working as it normally does and is handled at the networking level so I do not think is relevant.


For samples:

  • MSDN. Here is one for TCP
  • WCF_WF_CardSpace extensive samples on anything you need to know on WCF
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号