private void ThrowIfDisposed()
{
switch (_stateWhenDisposing)
{
case int.MinValue:
return;
case (int)WebSocketState.Closed:
case (int)WebSocketState.Aborted:
throw new WebSocketException(WebSocketError.InvalidState,
SR.Format(SR.net_WebSockets_InvalidState_ClosedOrAborted, typeof(WebSocketBase), _stateWhenDisposing));
default:
throw new ObjectDisposedException(GetType().FullName);
}
}