|
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) |
0 commit comments