| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -114,6 +114,7 @@ class ExternalReferenceRegistry { | |||
| 114 | 114 | V(task_queue) \ | |
| 115 | 115 | V(tcp_wrap) \ | |
| 116 | 116 | V(tty_wrap) \ | |
| 117 | + V(udp_wrap) \ | ||
| 117 | 118 | V(url) \ | |
| 118 | 119 | V(util) \ | |
| 119 | 120 | V(pipe_wrap) \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,10 +21,11 @@ | |||
| 21 | 21 | ||
| 22 | 22 | #include "udp_wrap.h" | |
| 23 | 23 | #include "env-inl.h" | |
| 24 | + #include "handle_wrap.h" | ||
| 24 | 25 | #include "node_buffer.h" | |
| 25 | 26 | #include "node_errors.h" | |
| 27 | + #include "node_external_reference.h" | ||
| 26 | 28 | #include "node_sockaddr-inl.h" | |
| 27 | - #include "handle_wrap.h" | ||
| 28 | 29 | #include "req_wrap-inl.h" | |
| 29 | 30 | #include "util-inl.h" | |
| 30 | 31 | ||
@@ -133,6 +134,12 @@ void UDPWrapBase::AddMethods(Environment* env, Local<FunctionTemplate> t) { | |||
| 133 | 134 | SetProtoMethod(env->isolate(), t, "recvStop", RecvStop); | |
| 134 | 135 | } | |
| 135 | 136 | ||
| 137 | + void UDPWrapBase::RegisterExternalReferences( | ||
| 138 | + ExternalReferenceRegistry* registry) { | ||
| 139 | + registry->Register(RecvStart); | ||
| 140 | + registry->Register(RecvStop); | ||
| 141 | + } | ||
| 142 | + | ||
| 136 | 143 | UDPWrap::UDPWrap(Environment* env, Local<Object> object) | |
| 137 | 144 | : HandleWrap(env, | |
| 138 | 145 | object, | |
@@ -229,6 +236,34 @@ void UDPWrap::Initialize(Local<Object> target, | |||
| 229 | 236 | constants).Check(); | |
| 230 | 237 | } | |
| 231 | 238 | ||
| 239 | + void UDPWrap::RegisterExternalReferences(ExternalReferenceRegistry* registry) { | ||
| 240 | + UDPWrapBase::RegisterExternalReferences(registry); | ||
| 241 | + registry->Register(New); | ||
| 242 | + registry->Register(GetFD); | ||
| 243 | + | ||
| 244 | + registry->Register(Open); | ||
| 245 | + registry->Register(Bind); | ||
| 246 | + registry->Register(Connect); | ||
| 247 | + registry->Register(Send); | ||
| 248 | + registry->Register(Bind6); | ||
| 249 | + registry->Register(Connect6); | ||
| 250 | + registry->Register(Send6); | ||
| 251 | + registry->Register(Disconnect); | ||
| 252 | + registry->Register(GetSockOrPeerName<UDPWrap, uv_udp_getpeername>); | ||
| 253 | + registry->Register(GetSockOrPeerName<UDPWrap, uv_udp_getsockname>); | ||
| 254 | + registry->Register(AddMembership); | ||
| 255 | + registry->Register(DropMembership); | ||
| 256 | + registry->Register(AddSourceSpecificMembership); | ||
| 257 | + registry->Register(DropSourceSpecificMembership); | ||
| 258 | + registry->Register(SetMulticastInterface); | ||
| 259 | + registry->Register(SetLibuvInt32<uv_udp_set_multicast_ttl>); | ||
| 260 | + registry->Register(SetLibuvInt32<uv_udp_set_multicast_loop>); | ||
| 261 | + registry->Register(SetLibuvInt32<uv_udp_set_broadcast>); | ||
| 262 | + registry->Register(SetLibuvInt32<uv_udp_set_ttl>); | ||
| 263 | + registry->Register(BufferSize); | ||
| 264 | + registry->Register(GetSendQueueSize); | ||
| 265 | + registry->Register(GetSendQueueCount); | ||
| 266 | + } | ||
| 232 | 267 | ||
| 233 | 268 | void UDPWrap::New(const FunctionCallbackInfo<Value>& args) { | |
| 234 | 269 | CHECK(args.IsConstructCall()); | |
@@ -807,3 +842,5 @@ void UDPWrap::GetSendQueueCount(const FunctionCallbackInfo<Value>& args) { | |||
| 807 | 842 | } // namespace node | |
| 808 | 843 | ||
| 809 | 844 | NODE_BINDING_CONTEXT_AWARE_INTERNAL(udp_wrap, node::UDPWrap::Initialize) | |
| 845 | + NODE_BINDING_EXTERNAL_REFERENCE(udp_wrap, | ||
| 846 | + node::UDPWrap::RegisterExternalReferences) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,6 +32,7 @@ | |||
| 32 | 32 | ||
| 33 | 33 | namespace node { | |
| 34 | 34 | ||
| 35 | + class ExternalReferenceRegistry; | ||
| 35 | 36 | class UDPWrapBase; | |
| 36 | 37 | ||
| 37 | 38 | // A listener that can be attached to an `UDPWrapBase` object and generally | |
@@ -110,6 +111,7 @@ class UDPWrapBase { | |||
| 110 | 111 | static void RecvStart(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 111 | 112 | static void RecvStop(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 112 | 113 | static void AddMethods(Environment* env, v8::Local<v8::FunctionTemplate> t); | |
| 114 | + static void RegisterExternalReferences(ExternalReferenceRegistry* registry); | ||
| 113 | 115 | ||
| 114 | 116 | private: | |
| 115 | 117 | UDPListener* listener_ = nullptr; | |
@@ -126,6 +128,7 @@ class UDPWrap final : public HandleWrap, | |||
| 126 | 128 | v8::Local<v8::Value> unused, | |
| 127 | 129 | v8::Local<v8::Context> context, | |
| 128 | 130 | void* priv); | |
| 131 | + static void RegisterExternalReferences(ExternalReferenceRegistry* registry); | ||
| 129 | 132 | static void GetFD(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 130 | 133 | static void New(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| 131 | 134 | static void Open(const v8::FunctionCallbackInfo<v8::Value>& args); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments