net: same tcp port listened without error on windows #30291
Closed
Comments
I think you perhaps might need to be informed that:
Also, the story of someone's adventure on the bind system call might be helpful: https://stackoverflow.com/questions/51071020/golang-net-listen-binds-to-port-thats-already-in-use Can you please re-visit your test programs and circumstances with the point of view mentioned above? |
That's it, I should use "tcp4" instead of "tcp" if I want it raise a error, otherwise, a dual-stack passive-open socket will work. XD |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
main.go
main.py
What did you expect to see?
Golang program should raise a port-had-been-used Error.
What did you see instead?
There are three conditions and which program listen on port first:
1. Golang Program vs Golang Program:
Second Golang Program raise a Error
2. Golang Program vs Python Program:
Golang first, Python second -> Both NO Error
Python first, Golang second -> Both NO Error
3. Golang Program vs C# or others Program:
Golang first, C# second -> C# raise a Error
C# first, Golang second -> Both NO Error
The text was updated successfully, but these errors were encountered: