koding / tunnel

Tunnel proxy package in Go
BSD 3-Clause "New" or "Revised" License
314 stars 70 forks source link

yamux: keepalive failed: session shutdown #45

Closed yarikbratashchuk closed 6 years ago

yarikbratashchuk commented 6 years ago

Hi)

I wonder how to reconnect client if errors like:

yamux: keepalive failed: session shutdown
yamux: keepalive failed: i/o deadline reached

appears?

Thanks for help)

rjeczalik commented 6 years ago

You can subscribe for connection state changes here and write your own handling.

Will that work for you?

yarikbratashchuk commented 6 years ago

Thanks for reply. So if i know that connection is dropped, what should i do? Run client.Start() to reconnect? Or i should do something with ClientConfig.Backoff?

rjeczalik commented 6 years ago

@yarikbratashchuk Sorry, I misread your question. Client automatically reconnects if the underlying connection is gone. I thought you wanted some extra handling.

yarikbratashchuk commented 6 years ago

Thanks for reply)

rjeczalik commented 6 years ago

You're welcome!