Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2021-08-31 18:20:36 +0300
committerJoyee Cheung <joyeec9h3@gmail.com>2021-09-06 13:12:51 +0300
commit995f945ee227a22ad0b6b10cbb6aab9fdf3c0258 (patch)
tree96a5aedb79fe85897900c3d58a381f71e93e3a3d /src/tcp_wrap.cc
parent3ec38f78604828f92bfd0a0887faf9d7c3e4bf27 (diff)
src: register external references of TCPWrap for snapshot
PR-URL: https://github.com/nodejs/node/pull/39961 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com>
Diffstat (limited to 'src/tcp_wrap.cc')
-rw-r--r--src/tcp_wrap.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc
index cd7174984e2..84b18a1592d 100644
--- a/src/tcp_wrap.cc
+++ b/src/tcp_wrap.cc
@@ -21,12 +21,13 @@
#include "tcp_wrap.h"
+#include "connect_wrap.h"
#include "connection_wrap.h"
#include "env-inl.h"
#include "handle_wrap.h"
#include "node_buffer.h"
+#include "node_external_reference.h"
#include "node_internals.h"
-#include "connect_wrap.h"
#include "stream_base-inl.h"
#include "stream_wrap.h"
#include "util-inl.h"
@@ -120,6 +121,23 @@ void TCPWrap::Initialize(Local<Object> target,
constants).Check();
}
+void TCPWrap::RegisterExternalReferences(ExternalReferenceRegistry* registry) {
+ registry->Register(New);
+ registry->Register(Open);
+ registry->Register(Bind);
+ registry->Register(Listen);
+ registry->Register(Connect);
+ registry->Register(Bind6);
+ registry->Register(Connect6);
+
+ registry->Register(GetSockOrPeerName<TCPWrap, uv_tcp_getsockname>);
+ registry->Register(GetSockOrPeerName<TCPWrap, uv_tcp_getpeername>);
+ registry->Register(SetNoDelay);
+ registry->Register(SetKeepAlive);
+#ifdef _WIN32
+ registry->Register(SetSimultaneousAccepts);
+#endif
+}
void TCPWrap::New(const FunctionCallbackInfo<Value>& args) {
// This constructor should not be exposed to public javascript.
@@ -393,3 +411,5 @@ Local<Object> AddressToJS(Environment* env,
} // namespace node
NODE_MODULE_CONTEXT_AWARE_INTERNAL(tcp_wrap, node::TCPWrap::Initialize)
+NODE_MODULE_EXTERNAL_REFERENCE(tcp_wrap,
+ node::TCPWrap::RegisterExternalReferences)