delphistompclient icon indicating copy to clipboard operation
delphistompclient copied to clipboard

Connection recovery

Open Mikanoshi opened this issue 6 years ago • 2 comments

How to reconnect after the connection loss? StompClient doesn't do this automatically. Heartbeat is enabled, it throws "10057 Socket is not connected" when encounters a problem and changes Connected to false, but nothing else happens. If I add this

if not lClient.Connected then lClient.Connect;

then there is a socket error 10054 Connection reset by peer (if network was down) or 10061 Connection Refused (if I killed connection using firewall's tool). Also tried lClient.Disconnect before connecting and even lClient := lClient.Clone;, same results.

Mikanoshi avatar Mar 02 '18 03:03 Mikanoshi

What's the problem? If you cannot connect and try to connect, an exception is raised. What should be a better option? May be I misunderstanding the problem.

danieleteti avatar Mar 26 '18 20:03 danieleteti

It does not connect at all after the network problems, keeps throwing different exceptions. Only restarting program helps.

Mikanoshi avatar Mar 26 '18 22:03 Mikanoshi