-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
dgram: follow the same standard of net for the default address #5487
Comments
+1 for consistency, no opinion on which one is more correct, if you don't get any more comments here just move forward with a PR, that'll make sure any concerns come out |
+1, sending to |
+1 to using |
@cjihrig when that was changed? Have you got a PR/issue so I can have a look around? @silverwind not exactly sure, @saghul knows better. |
+1. I can't think of any reason to keep this inconsistent. |
@mcollina I have no idea why it doesn't :-S Now, I think there are 2 different things here:
|
@mcollina sorry, I can't find an exact commit. |
Pr sent #5493 |
In net we default to 'localhost' as the default address for connect. Not doing the same on dgram is confusing, because sending to 0.0.0.0 works on Linux/OS X but not on Windows. Defaulting that to 127.0.0.1 / ::1 addresses that. Related: nodejs#5407 Related: nodejs#5398 Fixes: nodejs#5487
In net we default to 'localhost' as the default address for connect. Not doing the same on dgram is confusing, because sending to 0.0.0.0 works on Linux/OS X but not on Windows. Defaulting that to 127.0.0.1 / ::1 addresses that. Related: #5407 Related: #5398 Fixes: #5487 PR-URL: #5493 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
In net we default to 'localhost' as the default address for connect. Not doing the same on dgram is confusing, because sending to 0.0.0.0 works on Linux/OS X but not on Windows. Defaulting that to 127.0.0.1 / ::1 addresses that. Related: #5407 Related: #5398 Fixes: #5487 PR-URL: #5493 Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
In dgram, if you omit the
address
in send (https://nodejs.org/api/dgram.html#dgram_socket_send_msg_offset_length_port_address_callback), message is sent to'0.0.0.0'
or'::0'
whereas in net the default address fornet.connect
is'localhost'
(https://nodejs.org/api/net.html#net_net_connect_options_connectlistener).This behavior has been around since forever, making
dgram.send
default address not reliable (see #5407 (comment)).I propose to reconcile this two behavior, having
dgram
default to'localhost'
as well.This will be a semver-major change.
cc @silverwind @rvagg @mafintosh @feross
The text was updated successfully, but these errors were encountered: