需要使用 .NET Remoting 启动单独的后台进程进行进程间通信
我有一个抽象工厂,它将根据需要启动单独的进程(.NET EXE)。抽象工厂需要随时启动进程,并让新创建的进程能够与抽象工厂所在的进程进行通信。这种进程间通信将在创建它们的工厂完成。这些将是后台进程(不涉及 GUI)。这个问题可能的解决方案是什么?
.NET 远程处理或 PIPES 都使进程能够在启动后进行通信,但首先它们需要按需启动,并且它们将执行单独的独立进程(它们将显示在任务管理器以及常设进程中)并且然后,将进行进程间通信。
I have an abstract factory which will initiate separate processes (.NET EXE's) on demand. The abstract factory needs to initiate processes at any time and let the newly created processes be able to communicate with processes in which the abstract factory reside. This interprocess communication is going to be done at the factory that created them. These will be background processes (no GUI involved). What's the possible solution to this problem?
.NET remoting or PIPES both make the processes able to communicate after they have been initiated, but first they need to be initiated on demand and they'll execute separate standalone processes (They will be shown in task manager as well as standing process) and then after that, the interprocess communication will take place.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 System.IO.Pipes 命名空间。
匿名管道是为父子进程间通信而设计的。
如果您点击链接,则会提供示例。
您还可以使用命名的 互斥类 进行同步以及用于启动子进程的进程类。
Look at the System.IO.Pipes Namespace.
Anonymous pipes are designed for parent-child interprocess communication.
There are examples provided if you follow the link.
You can also use the named Mutex Class for synchronization and the Process Class for starting child processes.