Browse Source

[Modify] Throw an exception

pull/571/merge
sta 4 months ago
parent
commit
b972bcb343
  1. 9
      websocket-sharp/Server/WebSocketBehavior.cs

9
websocket-sharp/Server/WebSocketBehavior.cs

@ -356,12 +356,21 @@ namespace WebSocketSharp.Server
/// The default value is <see langword="null"/>.
/// </para>
/// </value>
/// <exception cref="InvalidOperationException">
/// The set operation is not available when the session has already started.
/// </exception>
public Func<string, bool> HostValidator {
get {
return _hostValidator;
}
set {
if (_websocket != null) {
var msg = "The set operation is not available.";
throw new InvalidOperationException (msg);
}
_hostValidator = value;
}
}

Loading…
Cancel
Save