Difference between the two codes on reconnection.

soumyadeep
The reconnection is done by using either of-
1. enable auto reconnection while initialising websocket:
kws = WebSocket("your_api_key", "your_public_token", "logged_in_user_id", reconnect=True, reconnect_interval=5, reconnect_tries=50)
2. kws.enable_reconnect(reconnect_interval=5, reconnect_tries=50)
What is the difference using these two commands? What relative advantage do I have as an user from one over the other? If the two codes do the same job, then why are there two commands (adding to complexity)?
Thanks
  • Vivek
    @soumyadeep You can either initialise auto reconnection while creating WebSocket connection or enable it anytime. Also note that while your program is running you might want to adjust reconnection params such as reconnect_interval and reconnect_interval so at that time you might want to user reconnect_interval method.
Sign In or Register to comment.