Remoting connection over TCP

Posted by Voyager Systems on Stack Overflow See other posts from Stack Overflow or by Voyager Systems
Published on 2009-04-05T19:54:18Z Indexed on 2010/06/03 22:04 UTC
Read the original article Hit count: 160

Filed under:
|
|

I've got a remoting server and client built. The server is set up as such:

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 );

The client is set up as such:

ChannelServices.RegisterChannel( new TcpChannel( 0 ), false );
m_Controller = (Controller)RemotingServices.Connect( typeof( Controller ), 
      "tcp://" + ip + ":2594/Controller" );

When I try to connect to the server from the same computer with the IP specified as 'localhost,' it connects fine. However, when I try to connect from a remote computer, not on the LAN, given the server's IP address, I receive the following exception on the client after a long wait:

A connection attempt failed because the connected party did not properly
respond after a period of time

How can I resolve this? I'm sure it's a configuration problem because the ports are forwarded properly on the server and there is no firewall active.

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about timeout