0

The .NET remote object call Activator.GetObject is slow, take several minutes.

//Server side
public void Conn (int nPort)
{
  IDictionary Prop = new Hashtable();
  Prop["port"]     = nPort;

  BinaryServerFormatterSinkProvider Server = new BinaryServerFormatterSinkProvider();
  BinaryClientFormatterSinkProvider Client = new BinaryClientFormatterSinkProvider();

  HttpChannel Channel = new HttpChannel(Prop,Client,Server);
  try
  {
    ChannelServices.RegisterChannel(Channel);
  }
  catch
  {
  }
  RemotingServices.Marshal(this,"S1");
}

// Client side
public S1Client(int nTimeout)
{
  IDictionary Prop = new Hashtable();
  Prop["timeout"]  = nTimeout;
  Prop["name"]     = "S1";

  BinaryServerFormatterSinkProvider Server = new BinaryServerFormatterSinkProvider();
  BinaryClientFormatterSinkProvider Client = new BinaryClientFormatterSinkProvider();
  HttpChannel channel = new HttpChannel(Prop,Client,Server);
  ChannelServices.RegisterChannel(channel);
}
public void Conn ()
{
  m_IS1 = (IS1)Activator.GetObject(typeof (IS1), m_strUrl + "/S1");
}

Why is the call so slow and what can I do to make it faster?

Could it be the network settings that is causing the problem and if so how to solve the problem?

Jan
  • 21
  • 2

0 Answers0