batch udp packet sending

This commit is contained in:
Jay Wren
2026-02-03 16:56:21 -05:00
parent 42bee7cf17
commit 15333f9fed
9 changed files with 133 additions and 1 deletions

View File

@@ -338,6 +338,15 @@ func (u *RIOConn) Rebind() error {
func (u *RIOConn) ReloadConfig(*config.C) {}
func (u *RIOConn) WriteBatch(pkts []BatchPacket) (int, error) {
for i := range pkts {
if err := u.WriteTo(pkts[i].Payload, pkts[i].Addr); err != nil {
return i, err
}
}
return len(pkts), nil
}
func (u *RIOConn) Close() error {
if !u.isOpen.CompareAndSwap(true, false) {
return nil