diff options
author | Jon Moss <me@jonathanmoss.me> | 2018-08-14 10:35:40 -0400 |
---|---|---|
committer | Jon Moss <me@jonathanmoss.me> | 2018-12-17 16:40:39 -0500 |
commit | 4b96a2a73b8117218c82e4dbbc491c81fd1b1fa4 (patch) | |
tree | 1f538e85f60544cac51def45a8fb11bc13bc967c /src/tcp_wrap.h | |
parent | 928f77638572e7590c806a6bfb74ea8f1b2fec19 (diff) | |
download | android-node-v8-4b96a2a73b8117218c82e4dbbc491c81fd1b1fa4.tar.gz android-node-v8-4b96a2a73b8117218c82e4dbbc491c81fd1b1fa4.tar.bz2 android-node-v8-4b96a2a73b8117218c82e4dbbc491c81fd1b1fa4.zip |
src: extract common Bind method
`TCPWrap::Bind` and `TCPWrap::Bind6` share a large amount of
functionality, so a common `Bind` was extracted to remove duplication.
PR-URL: https://github.com/nodejs/node/pull/22315
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Diffstat (limited to 'src/tcp_wrap.h')
-rw-r--r-- | src/tcp_wrap.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tcp_wrap.h b/src/tcp_wrap.h index a554832841..db269f6528 100644 --- a/src/tcp_wrap.h +++ b/src/tcp_wrap.h @@ -80,6 +80,11 @@ class TCPWrap : public ConnectionWrap<TCPWrap, uv_tcp_t> { static void Connect(const v8::FunctionCallbackInfo<v8::Value>& args, std::function<int(const char* ip_address, T* addr)> uv_ip_addr); static void Open(const v8::FunctionCallbackInfo<v8::Value>& args); + template <typename T> + static void Bind( + const v8::FunctionCallbackInfo<v8::Value>& args, + int family, + std::function<int(const char* ip_address, int port, T* addr)> uv_ip_addr); #ifdef _WIN32 static void SetSimultaneousAccepts( |