diff --git a/fasthttp/websocket/client.go b/fasthttp/websocket/client.go index e6e2fe4..6895734 100644 --- a/fasthttp/websocket/client.go +++ b/fasthttp/websocket/client.go @@ -135,14 +135,20 @@ RC_LOOP: continue RC_LOOP } + logging.Logger().Debugf("connection lost") + for indexI := 0; indexI < c.ReconnectTryTime; indexI++ { + logging.Logger().Debugf("trying reconnect[%d]", indexI) + conn, _, err := c.connect() if nil == err { + logging.Logger().Debugf("reconnected") c.reconnectedChan <- conn continue RC_LOOP } time.Sleep(c.ReconnectInterval) } + logging.Logger().Debugf("reconnecting has been failed") } }