diff options
author | Santiago Gimeno <santiago.gimeno@gmail.com> | 2019-03-17 01:03:48 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-04-03 07:48:13 +0300 |
commit | 9e960175d101fd2b41765353feab2f67c750aa5c (patch) | |
tree | 2e7d32c5f10a24428b970d61d9a66905bdf0852f /src/udp_wrap.h | |
parent | 38f0e382f7b431620323a3bb9cac052d3e7a539d (diff) |
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.
PR-URL: https://github.com/nodejs/node/pull/26871
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/udp_wrap.h')
-rw-r--r-- | src/udp_wrap.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/udp_wrap.h b/src/udp_wrap.h index 97d95b57d3d..fb2a9362cdf 100644 --- a/src/udp_wrap.h +++ b/src/udp_wrap.h @@ -45,9 +45,12 @@ class UDPWrap: public HandleWrap { static void New(const v8::FunctionCallbackInfo<v8::Value>& args); static void Open(const v8::FunctionCallbackInfo<v8::Value>& args); static void Bind(const v8::FunctionCallbackInfo<v8::Value>& args); + static void Connect(const v8::FunctionCallbackInfo<v8::Value>& args); static void Send(const v8::FunctionCallbackInfo<v8::Value>& args); static void Bind6(const v8::FunctionCallbackInfo<v8::Value>& args); + static void Connect6(const v8::FunctionCallbackInfo<v8::Value>& args); static void Send6(const v8::FunctionCallbackInfo<v8::Value>& args); + static void Disconnect(const v8::FunctionCallbackInfo<v8::Value>& args); static void RecvStart(const v8::FunctionCallbackInfo<v8::Value>& args); static void RecvStop(const v8::FunctionCallbackInfo<v8::Value>& args); static void AddMembership(const v8::FunctionCallbackInfo<v8::Value>& args); @@ -79,6 +82,8 @@ class UDPWrap: public HandleWrap { static void DoBind(const v8::FunctionCallbackInfo<v8::Value>& args, int family); + static void DoConnect(const v8::FunctionCallbackInfo<v8::Value>& args, + int family); static void DoSend(const v8::FunctionCallbackInfo<v8::Value>& args, int family); static void SetMembership(const v8::FunctionCallbackInfo<v8::Value>& args, |