[英]Remoting objects and remote connections
I'm using .NET remoting for some simple observer-based IPC. 我正在使用.NET远程处理一些基于观察者的简单IPC。 I've been having two problems:
我一直遇到两个问题:
I can't seem to accept clients from other computers over TCP. 我似乎无法通过TCP从其他计算机接受客户端。 I'm using a TcpChannel configured as such:
我正在使用这样配置的TcpChannel:
BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider(); serverProv.TypeFilterLevel = TypeFilterLevel.Full; BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider(); IDictionary props = new Hashtable(); props["port"] = port; TcpChannel channel = new TcpChannel( props, clientProv, serverProv ); ChannelServices.RegisterChannel( channel, false ); RemotingConfiguration.RegisterWellKnownServiceType( typeof( Controller ), "Controller", WellKnownObjectMode.Singleton );
And when a client app tries to connect ( m_Controller = (Controller)RemotingServices.Connect( typeof( Controller ), "tcp://" + ip + ":2594/Controller" ) )
, it always times out. 当客户端应用尝试连接时
( m_Controller = (Controller)RemotingServices.Connect( typeof( Controller ), "tcp://" + ip + ":2594/Controller" ) )
,它总是超时。 I am not behind a firewall and my ports are forwarded properly. 我没有在防火墙后面,并且端口已正确转发。 I can use this port for socket-based apps but not for remoting for some reason.
由于某些原因,我可以将此端口用于基于套接字的应用程序,但不能用于远程处理。 Please help!
请帮忙!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.