[Modify] Replace it
This commit is contained in:
parent
4a0ac8ed28
commit
443469f641
@ -1039,11 +1039,19 @@ namespace WebSocketSharp.Server
|
|||||||
/// </param>
|
/// </param>
|
||||||
public void Stop (CloseStatusCode code, string reason)
|
public void Stop (CloseStatusCode code, string reason)
|
||||||
{
|
{
|
||||||
lock (_sync) {
|
string msg;
|
||||||
var msg = _state.CheckIfAvailable (false, true, false) ??
|
if (!checkIfAvailable (false, true, false, false, out msg)) {
|
||||||
WebSocket.CheckCloseParameters (code, reason, false);
|
_logger.Error (msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (msg != null) {
|
if (!WebSocket.CheckParametersForClose (code, reason, false, out msg)) {
|
||||||
|
_logger.Error (msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
lock (_sync) {
|
||||||
|
if (!checkIfAvailable (false, true, false, false, out msg)) {
|
||||||
_logger.Error (msg);
|
_logger.Error (msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user