mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-21 04:04:43 +08:00
优化网络处理器
This commit is contained in:
@@ -129,6 +129,13 @@ func (tcpConn *TCPConn) ReadMsg() ([]byte, error) {
|
||||
return tcpConn.msgParser.Read(tcpConn)
|
||||
}
|
||||
|
||||
func (tcpConn *TCPConn) GetRecyclerReaderBytes() func (data []byte) {
|
||||
bytePool := tcpConn.msgParser.IBytesMempool
|
||||
return func(data []byte) {
|
||||
bytePool.ReleaseBytes(data)
|
||||
}
|
||||
}
|
||||
|
||||
func (tcpConn *TCPConn) ReleaseReadMsg(byteBuff []byte){
|
||||
tcpConn.msgParser.ReleaseBytes(byteBuff)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user