fix: transport.UDPConn 新增了 WithUDPLinuxTimestamping(false) 开关

This commit is contained in:
2026-03-27 01:59:17 +08:00
parent 5b231141a7
commit 8cec6a0766
7 changed files with 154 additions and 37 deletions

View File

@@ -24,7 +24,8 @@ type UDPClient struct {
// DialUDP 通过 UDP 连接到 server并发送 register 消息完成身份注册。
func DialUDP(serverAddr, peerID string, opts ...Option) (*UDPClient, error) {
options := clientOptions{
logger: latencylog.NoopLogger{},
logger: latencylog.NoopLogger{},
udpLinuxTimestamping: true,
}
for _, opt := range opts {
opt(&options)
@@ -56,6 +57,7 @@ func DialUDP(serverAddr, peerID string, opts ...Option) (*UDPClient, error) {
rawConn,
nil, // peer 侧已连接模式,不需要指定 peerAddr
transport.WithUDPLogger(options.logger, latencylog.NodeRolePeer, peerID),
transport.WithUDPLinuxTimestamping(options.udpLinuxTimestamping),
transport.WithUDPTXTimestampDebugLogger(options.txTimestampDebugLogger),
)
if err != nil {