Thank you for the resources, sadly it seems most of the underpinnings of asyncio are a bit over my head right now.
I understand the general logic behind line 104 in cacheclt.py, but not where I would implement it, for example, in the websocket echo client example.
I’m also not sure what other changes I would need to make (if any) due to the fact that it’s a coroutine.
So far I’ve only got this solution that remakes the factory and connection if it gets the onClose event.
On Saturday, June 28, 2014 10:15:52 PM UTC-4, Tobias Oberstein wrote:
Am 29.06.2014 03:53, schrieb Darkman802:
I’m trying to write a websocket client that is able to reconnect to the
server when it loses connection.
I see there is an example for reconnecting when using twisted at:
What would be the correct way to implement this when using Asyncio?
Well, one way would be: implement something like: upon connection loss,
sleep some time (possibly with exponential backoff) and then try to
connect (once). loop until connected. reset backoff upon connect.
something in this direction:
this might of interest too:
hope this helps,