Exemple #1
0
        public void testServerWithoutPort()
        {
            var server = new CrateServer("localhost");

            Assert.AreEqual("http", server.Scheme);
            Assert.AreEqual("localhost", server.Hostname);
            Assert.AreEqual(4200, server.Port);
        }
Exemple #2
0
        public void testDefaultConnection()
        {
            var server = new CrateServer();

            Assert.AreEqual("http", server.Scheme);
            Assert.AreEqual("localhost", server.Hostname);
            Assert.AreEqual(4200, server.Port);
        }
 private void addServer(CrateServer server)
 {
     lock (lockObj) {
         if (!activeServers.Contains(server))
         {
             activeServers.Add(server);
         }
     }
 }
 public void markAsFailed(CrateServer server)
 {
     lock (lockObj) {
         if (activeServers.Count == 1)
         {
             activeServers = allServers;
         }
         activeServers.Remove(server);
         Task.Delay(TimeSpan.FromMinutes(3)).ContinueWith(x => addServer(server));
         currentServer = 0;
     }
 }