Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function Connected not working when connection was closed unexpectedly #36

Open
ronaldobim opened this issue Sep 12, 2023 · 0 comments
Open

Comments

@ronaldobim
Copy link

To simulate the problem, use the TCPView tool to close the connection once the StompClient is connected. To solve the problem I just added a try..except. Because de function fails, I can't use method Disconnect to force a new connection.
TCPView.zip

OBS: I'm not use Synapse

function TStompClient.Connected: boolean;
begin
try
{$IFDEF USESYNAPSE}
Result := Assigned(FSynapseTCP) and FSynapseConnected;

{$ELSE}
// ClosedGracefully <> FTCP.Connected !!!
Result := Assigned(FTCP) and FTCP.Connected and (not FTCP.IOHandler.ClosedGracefully);
{$ENDIF}
except
Result := False;
end;
end;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant