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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.