Skip to content

Commit

Permalink
fix: adjust connection states, isconnected()
Browse files Browse the repository at this point in the history
  • Loading branch information
nedpals committed Feb 1, 2024
1 parent 815f944 commit 727f2f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/daemon/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ type ConnectionState int

const (
NotConnectedState ConnectionState = 0
ShutdownState ConnectionState = iota
ConnectedState ConnectionState = iota
InitializedState ConnectionState = iota
ShutdownState ConnectionState = iota
)

const defaultConnectDelay = 750 * time.Millisecond
Expand Down Expand Up @@ -58,7 +58,7 @@ func (c *Client) processIdField() jsonrpc2.CallOption {
}

func (c *Client) IsConnected() bool {
return c.rpcConn != nil && c.connState == ConnectedState
return c.rpcConn != nil && c.connState >= ConnectedState
}

func (c *Client) tryReconnect(reason error) error {
Expand Down

0 comments on commit 727f2f2

Please sign in to comment.