diff --git a/pkg/network/ClientMulticast.go b/pkg/network/ClientMulticast.go index 12dd29d..89b1d9c 100644 --- a/pkg/network/ClientMulticast.go +++ b/pkg/network/ClientMulticast.go @@ -50,7 +50,6 @@ func (client ClientMulticast) Run() { if failedRIA { return } - println("Interface ", lAddr.IP.String()) // Init UDP server flux con, failedDU := client.DialUdp(lAddr, rAddr) @@ -87,7 +86,7 @@ func ResolveInterfaceAddr(inter string) (*net.UDPAddr, bool) { //for _, addr := range addrs { // if utils.IsIPv4(addr.String()) { // println("Selected IP", addr.String()) - // lAddr, _ := net.ResolveUDPAddr("udp", "192.168.86.25:15502") + // lAddr, _ := net.ResolveUDPAddr("udp", "127.0.0.1:15502") // return lAddr, false // } //} @@ -96,7 +95,7 @@ func ResolveInterfaceAddr(inter string) (*net.UDPAddr, bool) { // DialUdp Ouvre une connection UDP func (client ClientMulticast) DialUdp(lAddr *net.UDPAddr, rAddr *net.UDPAddr) (*net.UDPConn, bool) { - con, errDial := net.DialUDP("udp", lAddr, rAddr) + con, errDial := net.DialUDP("udp", nil, rAddr) if errDial != nil { println(errDial.Error()) return nil, true diff --git a/pkg/utils/Network.go b/pkg/utils/Network.go index c860368..607d42c 100644 --- a/pkg/utils/Network.go +++ b/pkg/utils/Network.go @@ -21,6 +21,10 @@ func NetworkLister() { println("\n\nNetwork interface list :") for i, val := range inter { fmt.Printf("%d. %s\n", i, val.Name) + addrs, _ := val.Addrs() + for _, addr := range addrs { + println("-- ", addr.String()) + } } print("\n") }