private void ThrowIfInputClosed() { if (State == WebSocketState.CloseReceived) { throw new InvalidOperationException("Close already received."); } }