title: C# Mongo Driver: Getting Time out, Connection refused by the server (Strange behavior)
body: <p>I was working with Mongo DB 3.4.2, and I am facing an strange issue when accessing data from my API. The error message says:</p>
  
  <pre><code>"ClassName": "System.TimeoutException",
      "Message": "A timeout occured after 30000ms selecting a server usingCompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : \"1\", ConnectionMode : \"Automatic\", Type : \"Standalone\", State : \"Disconnected\", Servers : [{ ServerId: \"{ ClusterId : 1, EndPoint : \"ServerIp:27017\" }\", EndPoint: \"ServerIp:27017\", State: \"Disconnected\", Type: \"Unknown\", HeartbeatException: \"MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---&gt; System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
  </code></pre>
  
  <p>As you can see the issue says: <strong>"No connection could be made because the target machine actively refused it"</strong> and we have already verified the following:</p>
  
  <ul>
  <li>There is no block port on the server. </li>
  <li>The firewall is not blocking
  the port.</li>
  <li>There is no proxy involve in the process</li>
  </ul>
  
  <p><strong>The issue is solved by restarting the Mongo Db Service on the server, however the same issue comes up every 1 hour after restarting the service.</strong></p>
  
  <p>Could somebody please help me with this,</p>
  
  <p>Thanks</p>