dotnet remoting:
I am receiving the following error:
"An unhandled exception of type 'System.Net.Sockets.SocketException'
occurred in mscorlib.dll
Additional information: No connection could be made because the target
machine actively refused it"
while trying to connect to a server using a TCP channel hosted in a windows
service.
Any ideas to the cause? Do i need to do some kinda of setup on the server to
open the TCP port (I am wunning win 200 advanced server for client and server
and just started working on Remoting..;->)
I am attaching the server and client code
Server Object
----------------
public class Container : MarshalByRefObject
{
public Container()
{
//
// TODO: Add constructor logic here
//
}
public override object InitializeLifetimeService()
{
// this lets us keep the object around as long as the process hosting
them are running
return null;
}
private string containerName = "Testing";
public string MachineName
{
get
{
return System.Environment.MachineName;
}
}
public int ProcessId
{
get
{
return System.Diagnostics.Process.GetCurrentProcess().Id;
}
}
private string GetContainerName()
{
return containerName;
}
public string GivemeContainerName()
{
return GetContainerName();
}
public void ChangeContainerName(string values)
{
containerName = values;
}
}
Client Code
--------------
Hashtable properties = new Hashtable();
properties.Add("name", "TcpBinary");
BinaryClientFormatterSinkProvider formatter = new
BinaryClientFormatterSinkProvider();
TcpChannel channel = new TcpChannel(properties, formatter, null);
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownClientType(typeof(BusinessEntity.Container), "tcp://10.18.5.187:1002/RemoteHTTPHost/BusinessEntity.rem");
properties = null;
formatter = null;
channel = null;