Beispiel #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);
        }
Beispiel #2
0
        public void testDefaultConnection()
        {
            var server = new CrateServer();

            Assert.AreEqual("http", server.Scheme);
            Assert.AreEqual("localhost", server.Hostname);
            Assert.AreEqual(4200, server.Port);
        }
Beispiel #3
0
 private void addServer(CrateServer server)
 {
     lock (lockObj) {
         if (!activeServers.Contains(server))
         {
             activeServers.Add(server);
         }
     }
 }
Beispiel #4
0
 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;
     }
 }