Skip to content

Commit

Permalink
Use Int64 instead of Int32 for counting pings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Apr 11, 2024
1 parent afe94af commit cfde4a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type Conn struct {
closeMu sync.Mutex
closing bool

pingCounter atomic.Int32
pingCounter atomic.Int64
activePingsMu sync.Mutex
activePings map[string]chan<- struct{}
}
Expand Down Expand Up @@ -202,7 +202,7 @@ func (c *Conn) flate() bool {
func (c *Conn) Ping(ctx context.Context) error {
p := c.pingCounter.Add(1)

err := c.ping(ctx, strconv.Itoa(int(p)))
err := c.ping(ctx, strconv.FormatInt(p, 10))
if err != nil {
return fmt.Errorf("failed to ping: %w", err)
}
Expand Down

0 comments on commit cfde4a5

Please sign in to comment.