diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs
index fbcd65f5..e51b9e18 100644
--- a/websocket-sharp/WebSocket.cs
+++ b/websocket-sharp/WebSocket.cs
@@ -767,10 +767,6 @@ namespace WebSocketSharp
///
/// Gets or sets the time to wait for the response to the ping or close.
///
- ///
- /// The set operation works if the current state of the interface is
- /// New or Closed.
- ///
///
///
/// A that represents the time to wait for
@@ -784,6 +780,10 @@ namespace WebSocketSharp
///
/// The value specified for a set operation is zero or less.
///
+ ///
+ /// The set operation is not available when the current state of
+ /// the interface is neither New nor Closed.
+ ///
public TimeSpan WaitTime {
get {
return _waitTime;
@@ -797,8 +797,11 @@ namespace WebSocketSharp
}
lock (_forState) {
- if (!canSet ())
- return;
+ if (!canSet ()) {
+ var msg = "The set operation is not available.";
+
+ throw new InvalidOperationException (msg);
+ }
_waitTime = value;
}