예제 #1
0
        private VM_Manager(Microsoft.AspNet.SignalR.IHubContext hub)
        {
            _hubContext = hub;
            Connections = new ConcurrentDictionary<string, Libvirt.CS_Objects.Host>();
            _Libvirt_EventLoop = new Libvirt.Utilities.Default_EventLoop();
            _ErrorFunc = virErrorFunc;

            System.Web.Hosting.HostingEnvironment.QueueBackgroundWorkItem(ctx => _Libvirt_EventLoop.Start(ctx));
        }
예제 #2
0
 public void Dispose()
 {
     if (_Libvirt_EventLoop != null) _Libvirt_EventLoop.Dispose();
     _Libvirt_EventLoop = null;
     foreach (var item in Connections)
     {
         try
         {
             item.Value.Dispose();
         }
         catch (Exception ex)
         {
             Debug.WriteLine(ex.Message);
         }
     }
     Connections.Clear();
 }