Skip to content

Commit

Permalink
Add connsCount to Client
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkren committed Jun 15, 2019
1 parent abc46ed commit 5f7a9ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/dmsg/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,13 @@ func (c *Client) updateDiscEntry(ctx context.Context) error {
return c.dc.UpdateEntry(ctx, c.sk, entry)
}

func (c *Client) connsCount() int {
c.mx.RLock()
count := len(c.conns)
c.mx.RUnlock()
return count
}

func (c *Client) setConn(ctx context.Context, l *ClientConn) {
c.mx.Lock()
c.conns[l.remoteSrv] = l
Expand Down

0 comments on commit 5f7a9ea

Please sign in to comment.