private bool isConnected() { try { if (_client != null && _client.IsConnected) { return(true); } var instance = new EventEndpointLocator().GetInstance(_path); if (instance == null) { return(false); } _client = new SocketClient(); _client.Connect(instance.Port, (m) => _handler(m)); if (_client.IsConnected) { return(true); } _client = null; return(false); } catch { return(false); } }
private bool isConnected() { try { if (_client != null && _client.IsConnected) return true; var instance = new EventEndpointLocator().GetInstance(_path); if (instance == null) return false; _client = new SocketClient(); _client.Connect(instance.Port, (m) => _handler(m)); if (_client.IsConnected) return true; _client = null; return false; } catch { return false; } }