简体   繁体   English

C# WCF NetPipe防火墙规则

[英]C# WCF NetPipe firewall rules

I'm running service host with net pipe on one PC and I need to connect to this host from another PC in the network.我在一台 PC 上运行带有 net pipe 的服务主机,我需要从网络中的另一台 PC 连接到该主机。 Since net pipe doesn't have any port, I cannot find out what firewall exceptions must be implemented in on the PCs / network in order for these two PC successfully communicate.由于 net pipe 没有任何端口,我无法找出必须在 PC / 网络上实施哪些防火墙异常才能使这两台 PC 成功通信。 The service host is created following way服务主机的创建方式如下

            _host = new ServiceHost(_driverHandler,
       new Uri(DriversConfiguration.NetPipeUri));

        _host.AddServiceEndpoint(typeof(ISystemControl),
                                new NetNamedPipeBinding(),
                                DriversConfiguration.HostEndpoint);
        _host.Open();

Where NetPipeUri is "net.pipe://localhost" and HostEndpoint is "MyFancyApplication".其中 NetPipeUri 是“net.pipe://localhost”,HostEndpoint 是“MyFancyApplication”。 Any idea what firewall exceptions and network configuration (rules on routers) should I use in order to have it working?知道我应该使用什么防火墙例外和网络配置(路由器规则)才能使其正常工作吗?

The firewall is not the problem: netNamedPipeBinding binding provides cross-process communication on the same machine.防火墙不是问题:netNamedPipeBinding 绑定提供了同一台机器上的跨进程通信。 Named pipes DO NOT WORK across machines.命名管道不能跨机器工作。 https://docs.microsoft.com/fr-fr/dotnet/framework/wcf/samples/netnamedpipebinding https://docs.microsoft.com/fr-fr/dotnet/framework/wcf/samples/netnamedpipebinding

You have to add a NetTCPBinding to your service for remote clients您必须将 NetTCPBinding 添加到远程客户端的服务中

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

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