private bool canConnectTo(Instance info) { var client = ClientFactory.Invoke(); client.Connect(info.Port, (s) => {}); var connected = client.IsConnected; client.Disconnect(); if (!connected) _fs.DeleteFile(info.File); return connected; }
public CompleteSnippetHandler(ICacheBuilder cache, string keyPath, CommandEndpoint endpoint) { _cache = cache; _keyPath = keyPath; _endpoint = endpoint; _dispatch = (msg) => { Logger.Write("dispatching " + msg); _endpoint.Handle(msg); }; _editor = new EngineLocator(new FS()).GetInstance(_keyPath); }
private bool canConnectTo(Instance info) { var client = ClientFactory.Invoke(); client.Connect(info.Port, (s) => {}); var connected = client.IsConnected; client.Disconnect(); if (!connected) { try { Process.GetProcessById(info.ProcessID); } catch { _fs.DeleteFile(info.File); } } return connected; }