diff --git a/websocket-sharp/Server/WebSocketBehavior.cs b/websocket-sharp/Server/WebSocketBehavior.cs
index fbb37d72..d4ac13f3 100644
--- a/websocket-sharp/Server/WebSocketBehavior.cs
+++ b/websocket-sharp/Server/WebSocketBehavior.cs
@@ -356,12 +356,21 @@ namespace WebSocketSharp.Server
/// The default value is .
///
///
+ ///
+ /// The set operation is not available when the session has already started.
+ ///
public Func HostValidator {
get {
return _hostValidator;
}
set {
+ if (_websocket != null) {
+ var msg = "The set operation is not available.";
+
+ throw new InvalidOperationException (msg);
+ }
+
_hostValidator = value;
}
}