File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
internal/connectionmanager Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -88,3 +88,8 @@ func (conn *Conn) Close() error {
8888 conn .closeConnectionToManagerCh <- struct {}{}
8989 return conn .connectionManager .Close ()
9090}
91+
92+ // IsClosed returns whether the connection is closed or not
93+ func (conn * Conn ) IsClosed () bool {
94+ return conn .connectionManager .IsClosed ()
95+ }
Original file line number Diff line number Diff line change @@ -171,3 +171,11 @@ func (connManager *ConnectionManager) reconnect() error {
171171 connManager .connection = conn
172172 return nil
173173}
174+
175+ // IsClosed checks if the connection is closed
176+ func (connManager * ConnectionManager ) IsClosed () bool {
177+ connManager .connectionMu .Lock ()
178+ defer connManager .connectionMu .Unlock ()
179+
180+ return connManager .connection .IsClosed ()
181+ }
You can’t perform that action at this time.
0 commit comments