[Modify] Replace it

master
sta 9 years ago
parent eab8746d39
commit 97742b0667

@ -2322,10 +2322,15 @@ namespace WebSocketSharp
/// </param> /// </param>
public void Close (ushort code, string reason) public void Close (ushort 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);

Loading…
Cancel
Save