title: A connection attempt failed because the connected party did not properly respond... .NET Remoting
body: <p>I have two apps on two computers. These apps are communicating by .NET Remoting. 
  First app acts as server for access to database, second app acts as client and writes that data to another database. </p>
  
  <p>When my client calls some method on my remote object on server, I get following error: </p>
  
  <blockquote>
    <p>A connection attempt failed because the connected party did not
    properly respond after a period of time, or established connection
    failed because connected host has failed to respond
    192.168.200.60:31621</p>
  </blockquote>
  
  <p>Well, that's nice, but I don't know anything about IP address 192.168.200.60, I was connecting to 172.XXX.XXX.216. It seems that there are two network connections and it's somehow not good for remoting. </p>
  
  <p><code>ipcongif</code> on my server look like that: </p>
  
  <p><a href="https://i.stack.imgur.com/FbBgD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FbBgD.png" alt="enter image description here"></a></p>
  
  <p>Exactly the same solution works on another 3 computers with Windows 2000, Windows XP and Windows 7. Server is developed in .NET Framework 2.0.</p>
  
  <p>Client and server have common DLL library with two interfaces ICAOFactory and ICAO. First I create factory CAOFactory, which has method CreateCAO, which returns CAO object. When I call some method oh that ICAO object, it fails. </p>
  
  <p>This is how my server app registers remoting object:</p>
  
  <pre><code>TcpChannel channel = new TcpChannel(31621); 
  ChannelServices.RegisterChannel(channel, false);
  RemotingConfiguration.RegisterWellKnownServiceType(typeof(My_Server.CAOFactory), "My_Server", WellKnownObjectMode.Singleton);
  </code></pre>
  
  <p>This is how my client creates remote object: </p>
  
  <pre><code>My_Share.ICAOFactory srvFactory;
  My_Share.ICAO srvCAO;
  
  srvFactory = (My_Share.ICAOFactory)Activator.GetObject(typeof(Foerster_Share.ICAOFactory), "tcp://" + ip + ":" + port + "/My_Server");
  srvCAO = srvFactory.CreateCAO(); // no problem
  srvCAO.Init(dateTime); // problem
  </code></pre>
  
  <p>This is my CAOFactory object:</p>
  
  <pre><code>public class CAOFactory : MarshalByRefObject, ICAOFactory
  {
      public ICAO CreateCAO()
      {
          ICAO CAOObj = new CAO();
          return CAOObj;
      }
  
      public void GetClientCount(out long clientCountSum, out long clientCountMax, out long clientCountActive)
      {
          clientCountSum = 0;
          clientCountMax = 0;
          clientCountActive = 0;
          return;
      }
  
      public override object InitializeLifetimeService()
      {
          return null;
      }
  }
  </code></pre>
  
  <p>This is my CAO object: </p>
  
  <pre><code>public class CAO : MarshalByRefObject, ICAO
  {
      public void Ping()
      {
          return;
      }
  
      DateTime dtInit;
  
      public void Init(DateTime dt)
      {
          dtInit = dt;
      }
  
      // + some other methods
  }
  </code></pre>
  
  <p>Any help greatly appreciated!</p>