-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: mention errors thrown by methods called on an unbound dgram.Socket #33983
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, the error system is very inconsistent here, unfortunately … 😕 Thanks for the PR!
The text is fine as is, but if you want to fine-tune it even more, here's one more optional suggestion: Instead of |
Yeah, let's not be satisfied with 99% correct if we can be 100% correct with almost no effort. |
PR-URL: #33983 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 91d9cdf |
PR-URL: #33983 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #33983 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: #33983 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
While working on this I have discovered an inconsistency: given
dgram.Socket
instance is undbound, callingaddress()
on it results in a system errorEBADF
being thrown, while callingremoteAddress()
results inERR_SOCKET_DGRAM_NOT_CONNECTED
.Also, calling
send()
on an unbound socket throwsERR_SOCKET_BAD_PORT
which might also be found misguiding.These I believe are easy fixes. Once the documentation resembles the current state of things I can open another PR introducing a fix to it.
Also mentioned a side effect caused by
socket.addMembership()
andsocket.addSourceSpecificMembership()
. Not sure if it is desired.