[Modify] Replace it
This commit is contained in:
parent
4d11a61a58
commit
c0c05efd5c
@ -346,29 +346,21 @@ namespace WebSocketSharp
|
|||||||
}
|
}
|
||||||
|
|
||||||
set {
|
set {
|
||||||
|
string msg = null;
|
||||||
|
|
||||||
if (!_client) {
|
if (!_client) {
|
||||||
var msg = "The set operation cannot be used by servers.";
|
msg = "The set operation cannot be used by servers.";
|
||||||
throw new InvalidOperationException (msg);
|
throw new InvalidOperationException (msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_readyState == WebSocketState.Open) {
|
if (!canSet (out msg)) {
|
||||||
_logger.Warn ("The connection has already been established.");
|
_logger.Warn (msg);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_readyState == WebSocketState.Closing) {
|
|
||||||
_logger.Warn ("The connection is closing.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (_forState) {
|
lock (_forState) {
|
||||||
if (_readyState == WebSocketState.Open) {
|
if (!canSet (out msg)) {
|
||||||
_logger.Warn ("The connection has already been established.");
|
_logger.Warn (msg);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_readyState == WebSocketState.Closing) {
|
|
||||||
_logger.Warn ("The connection is closing.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user