Created
October 8, 2015 00:31
-
-
Save xrl/9652f0096b32a4326824 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for _,maddr := range maddrs { | |
scamp.Trace.Printf("maddr: `%s`", maddr) | |
} | |
udpAddr, err := net.ResolveUDPAddr("udp", multicastSpec) | |
if err != nil { | |
scamp.Trace.Printf("error resolving UDP address: `%s`", udpAddr) | |
} | |
multicastConn, err := net.DialUDP("udp", nil, udpAddr) | |
if err != nil { | |
scamp.Trace.Printf("could not dial multicast address: `%s`", err) | |
} | |
scamp.Trace.Printf("starting announce loop...") | |
for { | |
multicastConn.Write([]byte("hello, world\n")) | |
time.Sleep(1 * time.Second) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment