New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: UDP broadcast client can not receive the answer message #13391
Comments
CC @mikioh |
Your Go and Python code don't match. Try using ListenUDP instead of DialUDP, and the WriteTo and ReadFrom methods instead of Write and Read. |
@mdempsky You means I should use ListenUDP in the client code? BTW, the go version server can work with the python version client. |
Also, if the go version client do not use a broadcast IP, it works correctly. |
This is not an issue of net package. See the following:
|
What is the correct way to write the client code with go? |
Please ask that sort of question at https://github.com/golang/go/wiki#the-go-community. |
The udp server can receive and send back message with no errors, but the go version udp client can not receive the server side reply. I also write a client with python, and it works.
Here is the server side code with golang:
And the client side code:
The python version client code:
The text was updated successfully, but these errors were encountered: