Skip to content

Commit cfde4a5

Browse files
committed
Use Int64 instead of Int32 for counting pings
1 parent afe94af commit cfde4a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

conn.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type Conn struct {
7777
closeMu sync.Mutex
7878
closing bool
7979

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

205-
err := c.ping(ctx, strconv.Itoa(int(p)))
205+
err := c.ping(ctx, strconv.FormatInt(p, 10))
206206
if err != nil {
207207
return fmt.Errorf("failed to ping: %w", err)
208208
}

0 commit comments

Comments
 (0)