mirror of
https://github.com/onyx-and-iris/q3rcon-proxy.git
synced 2025-01-18 08:40:53 +00:00
reuse single buffers
This commit is contained in:
parent
826756eb6e
commit
6cd90ae1dd
@ -38,8 +38,8 @@ func newSession(caddr *net.UDPAddr, raddr *net.UDPAddr, proxyConn *net.UDPConn)
|
||||
}
|
||||
|
||||
func (s *session) listen() error {
|
||||
for {
|
||||
buf := make([]byte, 2048)
|
||||
for {
|
||||
n, err := s.serverConn.Read(buf)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
|
@ -46,8 +46,8 @@ func (c *Client) ListenAndServe() error {
|
||||
|
||||
go c.pruneSessions()
|
||||
|
||||
for {
|
||||
buf := make([]byte, 2048)
|
||||
for {
|
||||
n, caddr, err := c.proxyConn.ReadFromUDP(buf)
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
|
Loading…
Reference in New Issue
Block a user