no read deadline
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 27s
Build and Publish / BuildAndDeploy (push) Successful in 2m6s

This commit is contained in:
matst80
2024-11-12 20:37:04 +01:00
parent 5f1f7ee25a
commit 983d1d52ae

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"log"
"sync"
"time"
)
type CartPacketQueue struct {
@@ -40,12 +39,10 @@ func (p *CartPacketQueue) HandleConnection(connection *PersistentConnection) err
defer p.RemoveListeners()
defer connection.Close()
var packet CartPacket
connection.SetReadDeadline(time.Now().Add(time.Millisecond * 200))
reader := bufio.NewReader(connection)
for {
err := ReadCartPacket(reader, &packet)
if err != nil {
log.Printf("Error receiving packet: %v\n", err)
return connection.HandleConnectionError(err)
}