mirror of
https://github.com/daeuniverse/dae.git
synced 2025-01-22 02:07:50 +07:00
fix: udp panic when udpConn is not net.PacketConn
This commit is contained in:
parent
f2d5ed34fb
commit
d67fe075a3
@ -124,6 +124,9 @@ func (p *UdpEndpointPool) GetOrCreate(lAddr netip.AddrPort, createOption *UdpEnd
|
||||
if err != nil {
|
||||
return nil, true, err
|
||||
}
|
||||
if _, ok = udpConn.(net.PacketConn); !ok {
|
||||
return nil, true, fmt.Errorf("protocol does not support udp")
|
||||
}
|
||||
ue = &UdpEndpoint{
|
||||
conn: udpConn.(net.PacketConn),
|
||||
deadlineTimer: time.AfterFunc(createOption.NatTimeout, func() {
|
||||
|
Loading…
Reference in New Issue
Block a user