-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: conn.WriteToUDP([]byte("not ok"), addr) #34758
Comments
This isn't a great bug report. You pasted a lot of code and said "all this code doesn't work". You will likely get more attention on this if you use the recommended bug template (which you deleted) and tell us what you expected to see and what happened instead, and details about your system (which macOS version?), etc. |
Here's almost certainly your problem, though: go Listen()
err := Dial() You have no coordination between starting to Listen and Dialing. Your Dial might happen before you even start to Listen. |
Removed the first example above and added only the short version and a timeout between listen and Dial. So basically if you copy paste the code above and run it you can compare the result between
Will add the rest of the template but in my opinion itsn't related to the issue but could be wrong. If I can make a guess I believe |
Thx Andrey Mirtchovski err was closing |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Don't know. Using master see go version
What operating system and processor architecture are you using (
go env
)?OSX Mojave 10.14.6
go env
OutputWhat did you do?
go build; ./example
What did you expect to see?
I expected using
n, err := conn.WriteToUDP([]byte("not ok"), addr)
to have the same result as using
n, err := conn.Write([]byte("ok"))
What did you see instead?
n, err := conn.WriteToUDP([]byte("not ok"), addr)
get stuck trying to connecthttps://play.golang.org/p/8Fq1XyYTFs1
The text was updated successfully, but these errors were encountered: