public static void Close(IPhysicalConnection conn) { IAsyncResult res = conn.BeginClose(null); Async.WaitFor(res); conn.EndClose(res); }
private void Disconnected(IAsyncResult async) { try { if (async != null) { Async.WaitFor(async); } //Properties["connected"] = ""; DispatchChangedProperties(); RealNode.CollapseNode(); if (async != null) { m_conn.EndClose(async); } } catch (Exception e) { Errors.Report(e); } m_connecting = false; OnDisconnect(); CallRefresh(); //ProcessRegister.RemoveBackgroundTask("s_disconnect"); }