VictorFrWu / bybit.go.api

Bybit Official Open API SDK
MIT License
8 stars 20 forks source link

[bug] websocket connection breakage unhandled #34

Closed San-B-09 closed 3 months ago

San-B-09 commented 4 months ago

Hi, I'm working with bybit websocket client for realtime klines. Whenever connection disconnects, client's handleIncomingMessages function just prints the log and return. As of now there's no way to understand if the connection is broken. It'll be pretty helpful if broken connection can be known from client so that re-connect can be initiated. Simply adding a function to know if connection is alive will also work.

VictorFrWu commented 3 months ago

add another goroutine to monitoring connection status and implement reconnect mechanism

San-B-09 commented 3 months ago

As an alternative I'm currently monitoring connection status by explicitly sending message on regular intervals in a separate goroutine. Is there any better alternative for monitoring connection status that I might be missing here ?