mirror of
https://github.com/aler9/gortsplib
synced 2025-11-02 21:14:07 +08:00
server: fix multicast listen error on Windows (https://github.com/aler9/rtsp-simple-server/issues/742)
This happened when the system has network interfaces that don't support multicast.
This commit is contained in:
@@ -108,9 +108,11 @@ func newServerUDPListener(
|
||||
listenIP = net.ParseIP(host)
|
||||
|
||||
for _, intf := range intfs {
|
||||
err := p.JoinGroup(&intf, &net.UDPAddr{IP: listenIP})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
if (intf.Flags & net.FlagMulticast) != 0 {
|
||||
err := p.JoinGroup(&intf, &net.UDPAddr{IP: listenIP})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user