mirror of
https://github.com/slackhq/nebula.git
synced 2026-02-15 17:24:23 +01:00
batch udp packet sending
This commit is contained in:
@@ -202,3 +202,12 @@ func (u *StdConn) Rebind() error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (u *StdConn) 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user