Skip to content

Commit

Permalink
ping buffer size 128
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhao committed Dec 15, 2018
1 parent 70aea49 commit a1960e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions proto/memcache/pinger.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const (
pingBufferSize = 8
pingBufferSize = 128
)

var (
Expand All @@ -32,8 +32,8 @@ type mcPinger struct {
func NewPinger(nc *libnet.Conn) proto.Pinger {
return &mcPinger{
conn: nc,
bw: bufio.NewWriter(nc),
br: bufio.NewReader(nc, bufio.NewBuffer(pingBufferSize)),
bw: bufio.NewWriter(nc),
}
}

Expand Down
6 changes: 5 additions & 1 deletion proto/redis/pinger.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (
"github.com/pkg/errors"
)

const (
pingBufferSize = 128
)

// errors
var (
ErrPingClosed = errs.New("ping interface has been closed")
Expand All @@ -36,7 +40,7 @@ type pinger struct {
func NewPinger(conn *libnet.Conn) proto.Pinger {
return &pinger{
conn: conn,
br: bufio.NewReader(conn, bufio.NewBuffer(7)),
br: bufio.NewReader(conn, bufio.NewBuffer(pingBufferSize)),
bw: bufio.NewWriter(conn),
state: opened,
}
Expand Down

0 comments on commit a1960e6

Please sign in to comment.