[Modify] Replace it

This commit is contained in:
sta 2016-08-28 16:10:52 +09:00
parent 9a5a28403f
commit 4dc757dc5c

View File

@ -2452,10 +2452,15 @@ namespace WebSocketSharp
/// </param> /// </param>
public void CloseAsync (ushort code) public void CloseAsync (ushort code)
{ {
var msg = _readyState.CheckIfAvailable (true, true, false, false) ?? string msg;
CheckCloseParameters (code, null, _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, null, _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);