Fix error handling in case of the port is in used (#810)

This commit is contained in:
Zoltan Papp
2023-04-14 16:18:00 +02:00
committed by GitHub
parent 9f35a7fb8d
commit 1803cf3678

View File

@@ -75,7 +75,7 @@ func (b *ICEBind) Open(uport uint16) ([]conn.ReceiveFunc, uint16, error) {
portAddr.Port(), nil
}
func listenNet(network string, port int) (*net.UDPConn, int, error) {
func listenNet(network string, port int) (net.PacketConn, int, error) {
c, err := net.ListenUDP(network, &net.UDPAddr{Port: port})
if err != nil {
return nil, 0, err