我应该使用什么技术来允许我的 Windows 服务或 Web 服务(用 C# 编写)发布其进度和状态?
要求: 我的 C# 3.5 中的 [windows/web] 服务会定期说明其状态。它可以是进度状态、日志条目、错误或警告,或者数据可用性信号。 客户端应用程序位于同一网络上,它们希望了解其中一些消息。 客户端随机启动和停止,很大程度上超出了我的控制范围。 客户端是用 C#、C++ 甚至 Delphi 编写的。 可支持存储我的服务消息的数据库连接可能不可用。
我希望我的服务能够发布其消息(基于文本的协议),以便订阅者能够查看并做出反应。我不想关心有多少客户端已连接,或者是否有客户端。
我正在研究命名管道、常规 TCP/IP、信号量,但我似乎找不到任何符合要求的东西。
目前,我被迫在网络上存储当前正在更新的文件,但它不干净,并且需要客户端有权访问网络共享。
The requirement:
My [windows/web] service in C# 3.5 periodically has something to say about its state. It could be a progress status, log entry, error or warning, or signal of data availability.
Client applications are on the same network, and they would like to learn about some of these messages.
Clients start and stop randomly, largely outside of my control.
Clients are written in C#, C++ and even Delphi.
Database connection that can support storing my service's messages may not be available.
I would like my service to publish its messages (text-based protocol) for subscribers to be able to see and react to. I don't want to bother with how many clients are connected, or are there clients at all.
I was looking into named pipes, regular TCP/IP, semaphores, but I cannot seem to find anything that fits the bill.
Currently I'm forced to store a file on the network that is being currently updated, but it's not clean, and requires clients to have access to a network share.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来您需要使用 WCF 来实现此目的。
WCF 可以处理命名管道、TCP/IP,并且可以处理 Windows 和 Web 服务。
你可以在这里看看:
http://msdn.microsoft.com/en-us/library/ms731082.aspx希望
这有帮助!
Looks like you need to use WCF for this.
WCF can handle named pipes, TCP/IP and it can do windows and Web services.
You can have a look here:
http://msdn.microsoft.com/en-us/library/ms731082.aspx
Hope this helps!
查看 OWIN 项目和 Kayak 实施。
它将允许您运行自己的进程内 Web 服务器。
Check out the OWIN project and the Kayak implementation.
It will allow you to run your own in-process web server.