From cae120fd4d495a70603599fa303b01a9bed3eeff Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Thu, 27 Aug 2015 17:51:15 +0200 Subject: [PATCH] Bind to IPv6 multicast group instead of :: This makes it possible to run multiple instances on the same box, all receiving local discovery packets. Tested on Mac, Windows, supposed to work on at least Linux too. For Windows, there may be issues with XP and earlier, but meh... --- lib/beacon/multicast.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/beacon/multicast.go b/lib/beacon/multicast.go index 75be61a45..8fb6a785e 100644 --- a/lib/beacon/multicast.go +++ b/lib/beacon/multicast.go @@ -8,7 +8,6 @@ package beacon import ( "errors" - "fmt" "net" "golang.org/x/net/ipv6" @@ -28,7 +27,7 @@ func NewMulticast(addr string) (*Multicast, error) { return nil, err } - conn, err := net.ListenPacket("udp6", fmt.Sprintf("[::]:%d", gaddr.Port)) + conn, err := net.ListenPacket("udp6", addr) if err != nil { return nil, err }