Merge pull request #4 from GreenLightning/master

Do not log "i/o timeout" errors
This commit is contained in:
Edward
2021-01-29 19:37:38 +08:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/use-go/onvif
go 1.14
go 1.15
require (
github.com/beevik/etree v1.1.0

View File

@@ -10,9 +10,11 @@ package wsdiscovery
*******************************************************/
import (
"errors"
"fmt"
"log"
"net"
"os"
"time"
"github.com/gofrs/uuid"
@@ -85,7 +87,9 @@ func sendUDPMulticast(msg string, interfaceName string) []string {
b := make([]byte, bufSize)
n, _, _, err := p.ReadFrom(b)
if err != nil {
fmt.Println(err)
if !errors.Is(err, os.ErrDeadlineExceeded) {
fmt.Println(err)
}
break
}
result = append(result, string(b[0:n]))