stan.py icon indicating copy to clipboard operation
stan.py copied to clipboard

Cannot reconnect after connection is lost due to PING

Open maruqu opened this issue 5 years ago • 1 comments

When the server in not available for some time, _close_due_to_ping is called due to PING failure. This method calls _close, which has a following docstring : """Removes any present internal state from the client.""" , which is if fact not true.

My problem is caused by not reseting self._ping_out. This causes the client to fail instantly after another .connect(...). I think that it should be set to 0 in self._close() method.

I saw your snippet: https://gist.github.com/wallyqs/31215101fc6ed18e49664eb0f64252c5 , but in my current design I would like to use the same STAN() client object to handle communication with the server for the lifetime of the process.

I was able to overcome it by reseting sc._ping_out in conn_lost_cb but I my opinion it should happen automatically.

What do you think?

maruqu avatar Dec 23 '19 11:12 maruqu

The same problem.

gavrilyuc avatar Mar 05 '21 09:03 gavrilyuc