mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
Separate read and write buffers for PubSub.
This commit is contained in:
@ -21,12 +21,11 @@ type Conn struct {
|
||||
}
|
||||
|
||||
func NewConn(netConn net.Conn) *Conn {
|
||||
buf := make([]byte, 4096)
|
||||
cn := &Conn{
|
||||
netConn: netConn,
|
||||
Wb: proto.NewWriteBuffer(buf),
|
||||
Wb: proto.NewWriteBuffer(),
|
||||
}
|
||||
cn.Rd = proto.NewReader(cn.netConn, buf)
|
||||
cn.Rd = proto.NewReader(cn.netConn)
|
||||
cn.SetUsedAt(time.Now())
|
||||
return cn
|
||||
}
|
||||
|
Reference in New Issue
Block a user