Fixes #2, allow server goroutines to exit on deadlines and context cancel.
This commit is contained in:
parent
03ca0f77e6
commit
e82f5a97c9
5 changed files with 108 additions and 58 deletions
|
|
@ -13,6 +13,8 @@ var targetPorts = []int{22600, 21600}
|
|||
// AutodiscoverCamera will try to find a camera using UDP Broadcasts
|
||||
func AutodiscoverCamera(verbose bool) (net.IP, error) {
|
||||
conn, err := net.ListenPacket("udp", ":22601")
|
||||
conn.SetReadDeadline(time.Now().Add(5 * time.Second))
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue