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)); }
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(); }