Remoting Factory Problems

Tech-Archive recommends: Fix windows errors by optimizing your registry



I'm trying to have a singleton server return a new session upon client
request. I thought I was using the traditional factory pattern, but
it is having problems connecting to the new session after the sever
creates it. The code has no trouble remoting to the server; the
sessions are the problem. The client code returns the 'connection
actively refused by target' exception.

Since the server and all of its new sessions exist on the same
channel, and since I can telnet into it, I know the connection is
alive. Also, the code works when client/server are running on one
machine.

Any help appreciated
----------------------------------------------------------------------------------------------------

A simplified code extraction:

public class Session : MarshalByRefObject
{
in data;
public Session(int d;) { data = d; }
}

SERVER
public class Server() : MarshalByRefObject
{
public Server()
{
channel = new TcpChannel(connectionConfig.port);
ChannelServices.RegisterChannel(channel, false);

RemotingConfiguration.RegisterWellKnownServiceType(
typeof(Server), connectionConfig.name,
WellKnownObjectMode.Singleton);
}

public ISession CreateSession() {return new Session(int
data);}
}

CLIENT
public class Client()
{
//setup etc are omitted for brevity

public void Connect()
{
IServer sessionMgr = (IServer)Activator.GetObject(
typeof(IServer), String.Format("tcp://{0}:{1}/{2}",
serverAddress,
connectionConfig.port,
connectionConfig.name));

Session s = sessionMgr.CreateSession(); // this works
nicely, showing the server is connected

int d = s.GetData(); // THIS SAYS TARGET ACTIVELY
REFUSED CONNECTION???
}

.



Relevant Pages

  • Re: .Net Scalability problem
    ... LoadRunner will peak out a server with a few virtual users. ... To get an idea of load, ... Fire off the test client and watch the number of ... > So I think that the MTC generate concurrent connection and per ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Connection lost at same time every hour (sometimes)
    ... After making the two following alterations on the server the problem seems ... After analyze your ipconfig on SBS and client, ... Then, other connection is good, ...
    (microsoft.public.windows.server.sbs)
  • Re: server disconnection - very often
    ... Reason of permanent popups is VMware server aplication on clients. ... Run CEICW to configure the network of SBS: ... Two network adapters - manual router connection to broadband ... Uninstall VMware on client. ...
    (microsoft.public.windows.server.sbs)
  • Re: Lan setup 2 nic
    ... The external nic only has TCP/IP enabled. ... Ipconfig of the server is looking good, but the client is still missing the ... > connection so we have a 2 nic with router setup now. ...
    (microsoft.public.windows.server.sbs)
  • Re: Regular disconnections from remote web workplace
    ... I can connect to office server and all office clients from home at all times ... be physically working right up until the connection is lost. ... If I enter http://companyip from a client I receive the login screen for the ... Click Services tab and select Hide All Microsoft Services and Disable ...
    (microsoft.public.windows.server.sbs)