HeartbeatException at connection attempt

Hello,

I am working on a company computer which is not connected to the internet for security purposes (in c#).
When trying to connect to the database

var connectionString = $“mongodb://myIP:myPort”;
var clientSettings = MongoClientSettings.FromUrl(new MongoUrl(connectionString));
var client = new MongoClient(clientSettings);

I get the following error (which is found in client.Cluster.Description):

HeartbeatException: "Mongodb.Driver.MongoConnectionsException: An exception occured while opening connection to the server. —> System.Net.Sockets.SocketException: An invalid argument was supplied at System.Net.Sockets.Socket…ctor…

If I try to get a collection I get a timeout.
I tried connecting to a replica set and it didn’t work.
Also, it does work on certain computers on the company network, but not on all.

I would appreciate some help with the matter.
Thanks!

1 Like