dgram: follow the same standard of net for the default address #5487
Closed
Description
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 for net.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.