* Patch from Andrew Haines: do not send close connection message if already closed

This commit is contained in:
Michaël Van Canneyt 2022-12-27 09:30:07 +01:00
parent 23d61350bd
commit 4f054f4097

View File

@ -475,7 +475,7 @@ procedure TCustomWebsocketClient.Disconnect(SendClose : boolean = true);
begin begin
if Not Active then if Not Active then
Exit; Exit;
if SendClose then if SendClose and (Connection.CloseState <> csClosed) then
Connection.Close(''); Connection.Close('');
if Assigned(MessagePump) then if Assigned(MessagePump) then
MessagePump.RemoveClient(Connection); MessagePump.RemoveClient(Connection);