Skip to content

dgram: add support for UDP connected sockets

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.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Would like some feedback as I'm not sure about some decisions I made:

  • Should a disconnect event be added?
  • I'm throwing on the ENOTCONN and EISCONN errors. Should I be emitting an event instead?
  • The send() is now more overloaded than ever.

Thanks

Merge request reports

Loading