@@ -62,7 +62,6 @@ MaybeLocal<Object> PipeWrap::Instantiate(Environment* env,
6262 constructor->NewInstance (env->context (), 1 , &type_value));
6363}
6464
65-
6665void PipeWrap::Initialize (Local<Object> target,
6766 Local<Value> unused,
6867 Local<Context> context,
@@ -71,8 +70,7 @@ void PipeWrap::Initialize(Local<Object> target,
7170 Isolate* isolate = env->isolate ();
7271
7372 Local<FunctionTemplate> t = NewFunctionTemplate (isolate, New);
74- t->InstanceTemplate ()
75- ->SetInternalFieldCount (StreamBase::kInternalFieldCount );
73+ t->InstanceTemplate ()->SetInternalFieldCount (StreamBase::kInternalFieldCount );
7674
7775 t->Inherit (LibuvStreamWrap::GetConstructorTemplate (env));
7876
@@ -102,9 +100,7 @@ void PipeWrap::Initialize(Local<Object> target,
102100 NODE_DEFINE_CONSTANT (constants, IPC);
103101 NODE_DEFINE_CONSTANT (constants, UV_READABLE);
104102 NODE_DEFINE_CONSTANT (constants, UV_WRITABLE);
105- target->Set (context,
106- env->constants_string (),
107- constants).Check ();
103+ target->Set (context, env->constants_string (), constants).Check ();
108104}
109105
110106void PipeWrap::RegisterExternalReferences (ExternalReferenceRegistry* registry) {
@@ -152,7 +148,6 @@ void PipeWrap::New(const FunctionCallbackInfo<Value>& args) {
152148 new PipeWrap (env, args.This (), provider, ipc);
153149}
154150
155-
156151PipeWrap::PipeWrap (Environment* env,
157152 Local<Object> object,
158153 ProviderType provider,
@@ -163,16 +158,14 @@ PipeWrap::PipeWrap(Environment* env,
163158 // Suggestion: uv_pipe_init() returns void.
164159}
165160
166-
167161void PipeWrap::Bind (const FunctionCallbackInfo<Value>& args) {
168162 PipeWrap* wrap;
169163 ASSIGN_OR_RETURN_UNWRAP (&wrap, args.Holder ());
170164 node::Utf8Value name (args.GetIsolate (), args[0 ]);
171- int err = uv_pipe_bind (&wrap->handle_ , *name);
165+ int err = uv_pipe_bind2 (&wrap->handle_ , *name, name. length (), 0 );
172166 args.GetReturnValue ().Set (err);
173167}
174168
175-
176169#ifdef _WIN32
177170void PipeWrap::SetPendingInstances (const FunctionCallbackInfo<Value>& args) {
178171 PipeWrap* wrap;
@@ -183,7 +176,6 @@ void PipeWrap::SetPendingInstances(const FunctionCallbackInfo<Value>& args) {
183176}
184177#endif
185178
186-
187179void PipeWrap::Fchmod (const v8::FunctionCallbackInfo<v8::Value>& args) {
188180 PipeWrap* wrap;
189181 ASSIGN_OR_RETURN_UNWRAP (&wrap, args.Holder ());
@@ -193,20 +185,17 @@ void PipeWrap::Fchmod(const v8::FunctionCallbackInfo<v8::Value>& args) {
193185 args.GetReturnValue ().Set (err);
194186}
195187
196-
197188void PipeWrap::Listen (const FunctionCallbackInfo<Value>& args) {
198189 PipeWrap* wrap;
199190 ASSIGN_OR_RETURN_UNWRAP (&wrap, args.Holder ());
200191 Environment* env = wrap->env ();
201192 int backlog;
202193 if (!args[0 ]->Int32Value (env->context ()).To (&backlog)) return ;
203- int err = uv_listen (reinterpret_cast <uv_stream_t *>(&wrap->handle_ ),
204- backlog,
205- OnConnection);
194+ int err = uv_listen (
195+ reinterpret_cast <uv_stream_t *>(&wrap->handle_ ), backlog, OnConnection);
206196 args.GetReturnValue ().Set (err);
207197}
208198
209-
210199void PipeWrap::Open (const FunctionCallbackInfo<Value>& args) {
211200 Environment* env = Environment::GetCurrent (args);
212201
@@ -222,7 +211,6 @@ void PipeWrap::Open(const FunctionCallbackInfo<Value>& args) {
222211 args.GetReturnValue ().Set (err);
223212}
224213
225-
226214void PipeWrap::Connect (const FunctionCallbackInfo<Value>& args) {
227215 Environment* env = Environment::GetCurrent (args);
228216
@@ -237,10 +225,8 @@ void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {
237225
238226 ConnectWrap* req_wrap =
239227 new ConnectWrap (env, req_wrap_obj, AsyncWrap::PROVIDER_PIPECONNECTWRAP);
240- req_wrap->Dispatch (uv_pipe_connect,
241- &wrap->handle_ ,
242- *name,
243- AfterConnect);
228+ req_wrap->Dispatch (
229+ uv_pipe_connect2, &wrap->handle_ , *name, name.length (), 0 , AfterConnect);
244230
245231 TRACE_EVENT_NESTABLE_ASYNC_BEGIN1 (TRACING_CATEGORY_NODE2 (net, native),
246232 " connect" ,
@@ -251,7 +237,6 @@ void PipeWrap::Connect(const FunctionCallbackInfo<Value>& args) {
251237 args.GetReturnValue ().Set (0 ); // uv_pipe_connect() doesn't return errors.
252238}
253239
254-
255240} // namespace node
256241
257242NODE_BINDING_CONTEXT_AWARE_INTERNAL (pipe_wrap, node::PipeWrap::Initialize)
0 commit comments