简体   繁体   中英

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. Ill be using .net 4.6.

The service will be spawning multiple servers which the user can create, start and stop via the UI.

Researching the best way for my UI to control my service and receive status information from the servers.

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. 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. 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. Found this post which is ideal. Very easy to implement and the user doesnt need to worry about selecting IP ports etc.

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

since we are listing all options, how about MemoryMappedFile in combination with a EventWaitHandle

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

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

MemoryMappedFile + EventWaitHandle compared to WCF

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

Signalr and OWIN/Katana

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. See link for good introduction.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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