[v10.x backport] dgram: add support for UDP connected sockets by GaryGSC · Pull Request #30480 · nodejs/node (original) (raw)

Added the dgram.connect() and dgram.disconnect() methods that
associate/disassociate a udp socket to/from a remote address.
It optimizes for cases where lots of packets are sent to the same
address.
Also added the dgram.remoteAddress() method to retrieve the associated
remote address.

PR-URL: #26871
Reviewed-By: Colin Ihrig cjihrig@gmail.com
Reviewed-By: Matteo Collina matteo.collina@gmail.com

(cherry picked from commit 9e96017)

Checklist

As an aside, this is only a backport of #26871. That PR had a backport-requested-v10.x label. Does this backport even make sense without the semver-major #21745? I don't know enough about UDP. @nodejs/dgram