When I run the section of my project in C# nothing happens for about 30 seconds and it sends that error message in the title above, I am currently using .NET 5 Framework, the latest mongo drivers and my own Mongo Host (I tried Mongo atlas and it didnt work either). I have no clue as to why this doesnt work and was wondering if anyone knew why.
MongoClientSettings settings = new MongoClientSettings();
settings.ConnectTimeout = new TimeSpan(1000);
settings.WaitQueueTimeout = new TimeSpan(0, 2, 0);
settings.MinConnectionPoolSize = 1;
settings.MaxConnectionPoolSize = 25;
settings.Server = new MongoServerAddress("139.99.197.10");
Console.WriteLine(" connected");
MongoClient client = new MongoClient(settings);
database = client.GetDatabase(name);
public static bool DoesUserExist(String paramLicense)
{
List<Profile> records = GetMongo().Load<Profile>("Users");
bool correctCredentials = false;
foreach (var record in records)
{
if (record.licenseKey.Equals(paramLicense, StringComparison.InvariantCultureIgnoreCase))
{
correctCredentials = true;
break;
}
}
if (correctCredentials) {
return true;
}
return false;
}