I am trying to establish a basic .NET Remoting communication between 2x 64bit windows machines. If Machine1 is acting as client and Machine2 as server, then everything works fine. The other way around the following exception occurs:
System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 172.16.7.44:6666
The server code:
TcpChannel channel = new TcpChannel(6666);
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(MyRemotableObject),"HelloWorld",WellKnownObjectMode.Singleton);
The client code:
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");
Any idea whats wrong with my code?
Windows Firewall? (Question author says this is not it.)
To track down connection issues the standard approach applies (apply in any order):
netstat -an
)Assuming that the same binaries/configs work one-way but not the other would tell me something amiss in the networking side of the house to start with.
Beyond Firewall, the only other connection refused experiences I've had have been:
I'd start with Firewall 1st - either by setting policy to exempt inbound requests on that socket, trust all sockets from the source IP, or by disabling it all-together. (personally the latter is quick and dirty as a test, but I would do the former in a production environment)
Beyond that event logs, audit trail if you do have firewall enabled but punched through. Netmon etc. all become your friends.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With