22 #ifndef SRC_UDP_WRAP_H_ 23 #define SRC_UDP_WRAP_H_ 25 #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 37 class UDPWrap:
public HandleWrap {
39 static void Initialize(v8::Local<v8::Object> target,
40 v8::Local<v8::Value> unused,
41 v8::Local<v8::Context> context);
42 static void GetFD(v8::Local<v8::String>,
43 const v8::PropertyCallbackInfo<v8::Value>&);
44 static void New(
const v8::FunctionCallbackInfo<v8::Value>& args);
45 static void Bind(
const v8::FunctionCallbackInfo<v8::Value>& args);
46 static void Send(
const v8::FunctionCallbackInfo<v8::Value>& args);
47 static void Bind6(
const v8::FunctionCallbackInfo<v8::Value>& args);
48 static void Send6(
const v8::FunctionCallbackInfo<v8::Value>& args);
49 static void RecvStart(
const v8::FunctionCallbackInfo<v8::Value>& args);
50 static void RecvStop(
const v8::FunctionCallbackInfo<v8::Value>& args);
51 static void AddMembership(
const v8::FunctionCallbackInfo<v8::Value>& args);
52 static void DropMembership(
const v8::FunctionCallbackInfo<v8::Value>& args);
53 static void SetMulticastTTL(
const v8::FunctionCallbackInfo<v8::Value>& args);
54 static void SetMulticastLoopback(
55 const v8::FunctionCallbackInfo<v8::Value>& args);
56 static void SetBroadcast(
const v8::FunctionCallbackInfo<v8::Value>& args);
57 static void SetTTL(
const v8::FunctionCallbackInfo<v8::Value>& args);
59 static v8::Local<v8::Object> Instantiate(Environment* env, AsyncWrap* parent);
62 size_t self_size()
const override {
return sizeof(*this); }
65 typedef uv_udp_t HandleType;
68 int (*F)(
const typename T::HandleType*, sockaddr*,
int*)>
69 friend void GetSockOrPeerName(
const v8::FunctionCallbackInfo<v8::Value>&);
71 UDPWrap(Environment* env, v8::Local<v8::Object>
object);
73 static void DoBind(
const v8::FunctionCallbackInfo<v8::Value>& args,
75 static void DoSend(
const v8::FunctionCallbackInfo<v8::Value>& args,
77 static void SetMembership(
const v8::FunctionCallbackInfo<v8::Value>& args,
78 uv_membership membership);
80 static void OnAlloc(uv_handle_t* handle,
81 size_t suggested_size,
83 static void OnSend(uv_udp_send_t*
req,
int status);
84 static void OnRecv(uv_udp_t* handle,
87 const struct sockaddr* addr,
95 #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 97 #endif // SRC_UDP_WRAP_H_
void Initialize(Local< Object > target, Local< Value > unused, Local< Context > context, void *priv)
MaybeLocal< Object > New(Isolate *isolate, Local< String > string, enum encoding enc)