Beispiel #1
0
 public void AddServer(string ip, int port, string user, string password, string domain)
 {
     if (_servers.ContainsKey(ip))
     {
         _serverController = _videoServersManager.GetServer(_servers[ip]);
     }
     else
     {
         var server = new VideoServerEntity
         {
             Address      = ip,
             Id           = Guid.NewGuid(),
             Name         = "My server",
             Port         = port,
             UserName     = user,     // "administrator",
             UserPassword = password, // "abc@123",
             UserDomain   = ""
         };                           //2020IMAGING
         _videoServersModel.AddServer(server);
         _servers.Add(ip, server.Id);
         _serverController = _videoServersManager.GetServer(server.Id);
         _serverController.ServerControllerError += (s, e) =>
         {
             var strerror = e.Error;
         };
         _logger.Info("Server Id:" + server.Id + "," + "Server IP :" + ip.ToString());
     }
     _serverController.Timeout = new TimeSpan(0, 3, 0);
 }
Beispiel #2
0
 public void AddServer(string ip, int port, string user, string password, string domain)
 {
     if (_servers.ContainsKey(ip))
     {
         _serverController = _videoServersManager.GetServer(_servers[ip]);
     }
     else
     {
         var server = new VideoServerEntity
         {
             Address      = ip,
             Id           = Guid.NewGuid(),
             Name         = "My server",
             Port         = port,
             UserName     = user,
             UserPassword = password,
             UserDomain   = string.Empty
         };//2020IMAGING
         _videoServersModel.AddServer(server);
         _servers.Add(ip, server.Id);
         _serverController = _videoServersManager.GetServer(server.Id);
     }
     _serverController.Timeout = new TimeSpan(0, 0, 10);
 }