revert packet concatenation

This commit is contained in:
wish
2024-11-09 17:39:14 +11:00
parent 7bf2fd5b8f
commit ab7bb0d004

View File

@@ -158,10 +158,13 @@ func (s *Session) sendLoop() {
if s.closed { if s.closed {
return return
} }
for len(s.sendPackets) > 0 {
pkt = <-s.sendPackets
err := s.cryptConn.SendPacket(append(pkt.data, []byte{0x00, 0x10}...)) err := s.cryptConn.SendPacket(append(pkt.data, []byte{0x00, 0x10}...))
if err != nil { if err != nil {
s.logger.Warn("Failed to send packet") s.logger.Warn("Failed to send packet")
} }
}
time.Sleep(time.Duration(_config.ErupeConfig.LoopDelay) * time.Millisecond) time.Sleep(time.Duration(_config.ErupeConfig.LoopDelay) * time.Millisecond)
} }
} }