private void ThrowIfOutputClosed() { if (State == WebSocketState.CloseSent) { throw new InvalidOperationException("Close already sent."); } }