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.
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