fix close of nil channel

This commit is contained in:
keakon 2024-01-24 18:35:26 +08:00
parent eed574195b
commit c7bb638ecb

View file

@ -50,6 +50,7 @@ func NewUDPHopPacketConn(addr *UDPHopAddr, hopInterval time.Duration) (net.Packe
HopInterval: hopInterval,
conn: conn,
addrIndex: index,
closeChan: make(chan struct{}),
}
go hConn.hopLoop()
return hConn, nil