进程之间在不同的计算机上运行在同一网络上推荐的方式进行沟通 [英] Recommended way to communicate between processes running on different computers on the same network

查看:221
本文介绍了进程之间在不同的计算机上运行在同一网络上推荐的方式进行沟通的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作应该是什么(希望)是一个小功能的.NET软件解决方案,将允许一个应用程序在同一网络上运行在多台计算机上的另一个应用程序的多个实例的状态报告。

I'm working on what should (hopefully) be a small feature for a .NET software solution that will allow one application to report on the status of multiple instances of another application running on more than one computer on the same network.

我看了看这个MSDN文章命名管道,并且设置了伟大的工作一个简单的客户端/服务器项目。然而,这是对的一样的计算机(因此对于 NamedPipeClientStream 的构造函数,我通过了。运行为<$ C $只有两个进程C>的serverName 参数)。试图运行在同一项目中的单独的的同一网络上的机器引起了客户端进程失败,报告说找不到网络路径。

I took a look at this MSDN article on named pipes, and set up a simple client/server project that worked great. However, this was only two processes running on the same computer (so for the NamedPipeClientStream constructor, I passed "." as the serverName parameter). Attempting to run this same project on separate machines on the same network caused the client process to fail, reporting that the network path was not found.

这可能绝对只是我的问题传递了错误的字符串作为的serverName 从客户端进程中。 (我试过的IP地址,以及我的认为的是本机的网络名称,但也许我有格式错误。)在任何情况下,在获取客户端/服务器IPC工作在不同的机器一定帮助在同一网络上会大大AP preciated。 (我也问这个问题,因为我甚至不知道是否使用命名管道是摆在首位的最合理的解决方案。)

This could definitely just be a matter of me passing the wrong string as serverName from within the client process. (I tried the IP address as well as what I believe was the machine's network name, but perhaps I had the format wrong.) In any case, some help on getting client/server IPC working on separate machines on the same network would be much appreciated. (I am also asking this question because I don't even know if using named pipes is the most logical solution in the first place.)

推荐答案

命名管道的工作,但它的棘手得到它的工作,如果所有的计算机不在同一个域。

Named pipes will work, but it's tricky to get it to work if all of the computers are not on the same domain.

另一种选择,当然,只是使用套接字。这不是要复杂得多用插座比它是使用命名管道。

Another option, of course, is just to use sockets. It's not much more complicated to use sockets than it is to use Named Pipes.

最后,如果所有的应用程序都.NET,则WCF是一个选项,以及。这里的主要好处是,你不必担心过度的线协议,它只是一系列的方法调用。虽然WCF确实增加了一些开销,在安全和配置方面。

Finally, if all applications are .NET, then WCF is an option as well. The main benefit here is that you don't have to worry the over-the-wire protocol, it's just a series of methods calls. Though WCF does add some overhead in terms of security and configuration.

这篇关于进程之间在不同的计算机上运行在同一网络上推荐的方式进行沟通的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆