achilleasa / dart_amqp

Dart AMQP client implementing protocol version 0.9.1
MIT License
79 stars 40 forks source link

Fix reconnect related bugs #112

Closed achilleasa closed 10 months ago

achilleasa commented 10 months ago

This PR fixes two issues in the reconnection-handling logic that were reported in #107:

1) The client error broadcast stream is now closed only if the client's close() method is explicitly called. This allows existing listeners to be re-used if the client opts to detect connection loss events and reconnect to the broker.

2) When reconnecting, the previous heartbeat check timer was overwritten without first being cancelled. As a result, the old timer would eventually fire and raise a HeartbeatFailedException which would in turn trigger a new connection attempt to be made.

fixes #107