FAQ
I'm using Win 8.1 x64 on two pc's - One works fine. The other never reads
multicast traffic that comes across the wire (wireshark shows the traffic
making it to the pc)

current code:

package main

import (
     "fmt"
     "github.com/miekg/dns"
     "log"
     "net"
)

const (
     ipv4 = "224.0.0.251:5353"
)

func main() {
     fmt.Println("Loading network components")

     group, err := net.ResolveUDPAddr("udp4", ipv4)

     if err != nil {
         log.Fatal(err)
     }

     //nic,err := net.InterfaceByIndex(0)

     c, err := net.ListenMulticastUDP("udp4", nil, group)
     if err != nil {
         log.Fatal(err)
     }

     log.Println(c.LocalAddr().String())

     for {
         buff := make([]byte, 4096)
         n, _, err := c.ReadFromUDP(buff)
         if err != nil {
             log.Println(err)
         }

         log.Println("payload received!")

         msg := &dns.Msg{}
         msg.Unpack(buff[:n])
         log.Println(msg.String())
     }

}
symptom: n, _, err := c.ReadFromUDP(buff) blocks, but never receives
traffic/doesn't bind to port

What I've tried: every form of Read on the connection. All block, none
receive. Statically set the network interface to my main nic. My home pc,
which is also Win 8.1 x64 works without issue. I'm hoping it's a setting in
windows, but I've done everything that I can imagine there as well,
verifying that the main nic was highest in the connections list and even
disabling all other network connections. Netstat -a shows that the program
never binds to the port. While the read is blocking, I can enable and
disable Bonjour (runs on the same port) without errors on either programs.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 14, '14 at 10:14p
activeFeb 14, '14 at 10:14p
posts1
users1
websitegolang.org

1 user in discussion

Justin Slauson: 1 post

People

Translate

site design / logo © 2022 Grokbase