[Modify] Replace it

This commit is contained in:
sta 2016-08-30 15:56:07 +09:00
parent 66221e5d55
commit 8c25d2533a

View File

@ -2574,10 +2574,15 @@ namespace WebSocketSharp
/// </param>
public void CloseAsync (CloseStatusCode code, string reason)
{
var msg = _readyState.CheckIfAvailable (true, true, false, false) ??
CheckCloseParameters (code, reason, _client);
string msg;
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);
error ("An error has occurred in closing the connection.", null);