Use existing interface

This commit is contained in:
Viktor Liu
2025-07-09 12:18:33 +02:00
parent 8c9a58056a
commit 3247b60668
2 changed files with 3 additions and 8 deletions
+2
View File
@@ -14,3 +14,5 @@ var (
// is not thread safe and should only be modified during init.
ControlFns = &controlFns
)
type BatchReader = batchReader
+1 -8
View File
@@ -3,15 +3,8 @@ package conn
import (
"net"
"sync"
"golang.org/x/net/ipv6"
)
// PacketReader abstracts ipv4.PacketConn and ipv6.PacketConn which both implement ReadBatch
type PacketReader interface {
ReadBatch([]ipv6.Message, int) (int, error)
}
type ReceiverCreator interface {
CreateReceiverFn(pc PacketReader, conn *net.UDPConn, rxOffload bool, msgPool *sync.Pool) ReceiveFunc
CreateReceiverFn(pc BatchReader, conn *net.UDPConn, rxOffload bool, msgPool *sync.Pool) ReceiveFunc
}