TcpService新增设置内存池接口

This commit is contained in:
boyce
2020-12-14 16:05:32 +08:00
parent e25eda14d1
commit 4796ad7404
8 changed files with 41 additions and 16 deletions

View File

@@ -38,7 +38,7 @@ func newTCPConn(conn net.Conn, pendingWriteNum int, msgParser *MsgParser) *TCPCo
break
}
_, err := conn.Write(b)
ReleaseByteSlice(b)
tcpConn.msgParser.ReleaseByteSlice(b)
if err != nil {
break
@@ -126,7 +126,7 @@ func (tcpConn *TCPConn) ReadMsg() ([]byte, error) {
}
func (tcpConn *TCPConn) ReleaseReadMsg(byteBuff []byte){
ReleaseByteSlice(byteBuff)
tcpConn.msgParser.ReleaseByteSlice(byteBuff)
}
func (tcpConn *TCPConn) WriteMsg(args ...[]byte) error {