public void OnClientFailed(V8DebugClient client) { if (Interlocked.CompareExchange(ref activeClient, null, client) == client) { listener.DisconnectClient(); } }
public void SendCommand(V8DebugClient client, string command) { if (client == activeClient) { listener.SendCommand(command); } }
private bool ConnectClient(WebSocket webSocket) { var client = new V8DebugClient(this, webSocket); if (Interlocked.CompareExchange(ref activeClient, client, null) == null) { listener.ConnectClient(); client.Start(); return(true); } return(false); }
private bool ConnectClient(WebSocket webSocket) { // ReSharper disable ConditionIsAlwaysTrueOrFalse // ReSharper disable HeuristicUnreachableCode var client = new V8DebugClient(this, webSocket); if (Interlocked.CompareExchange(ref activeClient, client, null) == null) { listener.ConnectClient(); client.Start(); return(true); } return(false); // ReSharper restore HeuristicUnreachableCode // ReSharper restore ConditionIsAlwaysTrueOrFalse }