Dan*_*nca 5 .net remoting c#-3.0
我试图在2x 64位Windows机器之间建立基本的.NET Remoting通信.如果Machine1充当客户端而Machine2充当服务器,那么一切正常.发生以下异常的另一种方法是:
System.Net.Sockets.SocketException:无法建立连接,因为目标计算机主动拒绝它172.16.7.44:6666
服务器代码:
TcpChannel channel = new TcpChannel(6666);
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(MyRemotableObject),"HelloWorld",WellKnownObjectMode.Singleton);
Run Code Online (Sandbox Code Playgroud)
客户端代码:
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
// Create an instance of the remote object
remoteObject = (MyRemotableObject)Activator.GetObject(
typeof(MyRemotableObject), "tcp://172.16.7.44:6666/HelloWorld");
Run Code Online (Sandbox Code Playgroud)
我的代码有什么问题吗?
Tom*_*lak 11
Windows防火墙?(问题作者说这不是它.)
要跟踪连接问题,标准方法适用(以任何顺序应用):
netstat -an
)假设相同的二进制文件/配置单向工作但不是另一个会告诉我在房子的网络方面开始时有什么不妥.
超越防火墙,唯一的其他连接拒绝了我以前的经历:
我从Firewall 1st开始 - 通过设置策略来免除该套接字上的入站请求,信任来自源IP的所有套接字,或者将它们全部禁用.(个人后者作为测试快速而肮脏,但我会在生产环境中做前者)
除了事件日志之外,如果您确实启用了防火墙但已经通过了审计跟踪.Netmon等都成了你的朋友.
归档时间: |
|
查看次数: |
10673 次 |
最近记录: |