-
Notifications
You must be signed in to change notification settings - Fork 18k
net: Listen("tcp", ":123456789") works #11715
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
Comments
This will happen for any ports higher than 0xFFFFFF. dtoi fails for inputs larger than that, which causes parsePort to take a different error path. The error message for ports >= 0xFFFFFF (16777215) on darwin is a bit more reasonable:
|
Actually, I get a decent error message on linux as well:
|
I mailed https://go-review.googlesource.com/#/c/12213, although I don't know if it's an acceptable fix and I'm sure it's not important for go1.5. |
Oh, I've realized now that I read your message wrong from the beginning. I thought you were getting a strange error message, but you're not getting an error at all for the higher port. I wasn't reproducing it correctly, as I was cross-compiling for linux from darwin. I see the real issue now when I compile and run from linux. |
CL https://golang.org/cl/12213 mentions this issue. |
Please open a new issue for consistent error messages. This issue needs to focus on the behavior of Listen w/ invalid arguments. |
CL https://golang.org/cl/12447 mentions this issue. |
CL: https://golang.org/cl/12213
Go version: go1.4.2 linux/amd64 (same result with Go 1.5beta1)
My code:
It prints:
[::]:52501
(always this port)What I expected: it should return an error.
If I use port ":66666", it prints:
panic: listen tcp: invalid port 66666
The text was updated successfully, but these errors were encountered: