Closed diyism closed 1 year ago
Asked openai chatgpt, it tell me the right answer, get rid of
conn, err := reuseport.Dial("udp", "0.0.0.0:15443", "192.168.0.2:15443")
and replace ", err := conn.Write(msg)" with ", err := conn.WriteTo(msg, &net.UDPAddr{IP: net.ParseIP("192.168.0.2"), Port: 15443})"
great, now it works, I close this issue.
the test.go:
compile the test.go and put it into the 192.168.0.1 and 192.168.0.2, and exec it in the two machines, but there's no message printed in both of the two machines, but if i stop one of them and keep the other run, and run "nc -u -p 15443 192.168.0.1 15443" in the stopped one, I can see many "Hello, world!" printing.
I can't understand why, any hint?