mirror of
https://github.com/slackhq/nebula.git
synced 2026-02-16 01:34:22 +01:00
batch udp packet sending
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user