简体   繁体   English

进程间通信-现代选择?

[英]Inter Process Communication - Modern Options?

Im developing a system with a windows service and a front end UI for configuration and controlling the windows service. 我正在开发具有Windows服务和用于配置和控制Windows服务的前端UI的系统。 Ill be using .net 4.6. 不适使用.net 4.6。

The service will be spawning multiple servers which the user can create, start and stop via the UI. 该服务将产生多个服务器,用户可以通过UI创建,启动和停止这些服务器。

Researching the best way for my UI to control my service and receive status information from the servers. 研究UI用来控制我的服务并从服务器接收状态信息的最佳方法。

From my research these are what ive found: 从我的研究中,我发现了以下内容:

  1. SQLITE - Create a message queue which the UI writes commands to, servers will read periodically and respond with another message queue. SQLITE-创建一个UI写入命令的消息队列,服务器将定期读取并使用另一个消息队列进行响应。 Not ideal as its not live and requires a polling system. 不理想,因为它没有生命并且需要轮询系统。

  2. Named/Anonymous Pipes - Live request/response. 命名/匿名管道-实时请求/响应。 Works, but its a bit clunky when it comes to dealing with multiple clients communicating with a single server. 是可行的,但是在处理与单个服务器通信的多个客户端时有点笨拙。

  3. WCF - Live Request/Response. WCF-实时请求/响应。 Nice and easy to implement except the user needs to worry about configuring a valid port for the system to run on. 易于实现且易于操作,只不过用户需要担心为运行系统配置有效端口。

  4. Roll my own communication protocol- Live request/response but same issue applies to picking port numbers. 滚动我自己的通信协议-实时请求/响应,但同样的问题也适用于选择端口号。

Anything else im missing with todays technology? 今天的技术还有什么我想念的吗?

I actually didnt realise that named pipes can be used with WCF. 我实际上没有意识到WCF可以使用命名管道。 Found this post which is ideal. 找到了理想的帖子。 Very easy to implement and the user doesnt need to worry about selecting IP ports etc. 易于实现,用户无需担心选择IP端口等问题。

https://stackoverflow.com/a/7833188/1680271 https://stackoverflow.com/a/7833188/1680271

since we are listing all options, how about MemoryMappedFile in combination with a EventWaitHandle 由于我们列出了所有选项,因此如何将MemoryMappedFile与EventWaitHandle结合使用

https://docs.microsoft.com/en-us/dotnet/standard/io/memory-mapped-files https://docs.microsoft.com/en-us/dotnet/standard/io/memory-mapped-files

https://docs.microsoft.com/en-us/dotnet/standard/threading/eventwaithandle https://docs.microsoft.com/en-us/dotnet/standard/threading/eventwaithandle

MemoryMappedFile + EventWaitHandle compared to WCF 与WCF比较的MemoryMappedFile + EventWaitHandle

https://www.techmikael.com/2010/02/blazing-fast-ipc-in-net-4-wcf-vs.html https://www.techmikael.com/2010/02/blazing-fast-ipc-in-net-4-wcf-vs.html

Signalr and OWIN/Katana Signalr和OWIN / Katana

https://docs.microsoft.com/en-us/aspnet/signalr/overview/deployment/tutorial-signalr-self-host https://docs.microsoft.com/en-us/aspnet/signalr/overview/deployment/tutorial-signalr-self-host

Do simple HTTP POST/GET request and response, with Signalr you can do real-time publish/subscribe. 执行简单的HTTP POST / GET请求和响应,使用Signalr,您可以进行实时发布/订阅。 See link for good introduction. 请参阅链接以获得良好的介绍。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM