[Modify] Replace it

This commit is contained in:
sta 2016-08-26 16:38:51 +09:00
parent 30b7e6937f
commit 63e0b2ca8c

View File

@ -2394,10 +2394,15 @@ namespace WebSocketSharp
/// </param> /// </param>
public void Close (CloseStatusCode code, string reason) public void Close (CloseStatusCode code, string reason)
{ {
var msg = _readyState.CheckIfAvailable (true, true, false, false) ?? string msg;
CheckCloseParameters (code, reason, _client); if (!checkIfAvailable (true, true, false, false, out msg)) {
_logger.Error (msg);
error ("An error has occurred in closing the connection.", null);
if (msg != null) { return;
}
if (!CheckParametersForClose (code, reason, _client, out msg)) {
_logger.Error (msg); _logger.Error (msg);
error ("An error has occurred in closing the connection.", null); error ("An error has occurred in closing the connection.", null);