用 C# 与 Windows 服务对话的 Windows 应用程序?
这是一个有争议的普遍问题。您建议我们使用什么来使 Winforms 客户端能够与 Windows 服务对话。我们的场景是这样的:我们有一个 Windows 服务(C# .Net Framework 4.0),它将大量不同的数据批量导入到数据库中。
Windows 客户端将使用户能够实时监控批处理进度、重新启动批处理以及执行其他简单的配置任务。
我有兴趣就使用哪些技术/方法以及原因进行一些友好的辩论。套接字连接、远程处理、WCF,无论您过去使用过什么。
如果有人有工作示例的链接,那就太好了。
这里有很多问题需要考虑...线程、网络距离和性能等...理想情况下,我希望它能够在 VPN 连接上正常工作,但这不是一个严格的要求。
谢谢!
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... threading, 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1) 套接字:级别太低
2) 远程处理:被 WCF 取代
3) WCF:使用 TCP 绑定的标准方法
4) 通过配置文件或数据库间接:值得考虑,以便客户端和服务器都可以与数据库通信并可以发送数据使用它的消息。取决于场景。
无线网络? VPN 应该让一切正常工作,并在网络级别处理,所以我认为不相关。
示例:
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: