stan.py
stan.py copied to clipboard
Cannot reconnect after connection is lost due to PING
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?
The same problem.