all groups > dotnet remoting > december 2004 >
You're in the

dotnet remoting

group:

TCP Remoting


TCP Remoting dotnet_nut
12/27/2004 3:07:02 PM
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;
Re: TCP Remoting Ken Kolda
12/27/2004 3:20:09 PM
Can you show the server code that you use to register your channel? Should
look something like:

TcpChannel channel = new TcpChannel(1002);
ChannelServices.RegisterChannel(channel);

Ken


[quoted text, click to view]
RemotingConfiguration.RegisterWellKnownClientType(typeof(BusinessEntity.Cont
ainer), "tcp://10.18.5.187:1002/RemoteHTTPHost/BusinessEntity.rem");
[quoted text, click to view]

AddThis Social Bookmark Button