File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,11 @@ void PipeWrap::Initialize(Local<Object> target,
8282 env->SetProtoMethod (t, " unref" , HandleWrap::Unref);
8383 env->SetProtoMethod (t, " ref" , HandleWrap::Ref);
8484
85+ #ifdef _WIN32
8586 StreamWrap::AddMethods (env, t);
87+ #else
88+ StreamWrap::AddMethods (env, t, StreamBase::kFlagHasWritev );
89+ #endif
8690
8791 env->SetProtoMethod (t, " bind" , Bind);
8892 env->SetProtoMethod (t, " listen" , Listen);
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const common = require ( '../common' ) ;
4+ const assert = require ( 'assert' ) ;
5+ const net = require ( 'net' ) ;
6+
7+ if ( common . isWindows ) {
8+ common . skip ( 'Unix-specific test' ) ;
9+ return ;
10+ }
11+
12+ common . refreshTmpDir ( ) ;
13+
14+ const server = net . createServer ( ( connection ) => {
15+ connection . on ( 'error' , ( err ) => {
16+ throw err ;
17+ } ) ;
18+
19+ const writev = connection . _writev . bind ( connection ) ;
20+ connection . _writev = common . mustCall ( writev ) ;
21+
22+ connection . cork ( ) ;
23+ connection . write ( 'pi' ) ;
24+ connection . write ( 'ng' ) ;
25+ connection . end ( ) ;
26+ } ) ;
27+
28+ server . on ( 'error' , ( err ) => {
29+ throw err ;
30+ } ) ;
31+
32+ server . listen ( common . PIPE , ( ) => {
33+ const client = net . connect ( common . PIPE ) ;
34+
35+ client . on ( 'error' , ( err ) => {
36+ throw err ;
37+ } ) ;
38+
39+ client . on ( 'data' , common . mustCall ( ( data ) => {
40+ assert . strictEqual ( data . toString ( ) , 'ping' ) ;
41+ } ) ) ;
42+
43+ client . on ( 'end' , ( ) => {
44+ server . close ( ) ;
45+ } ) ;
46+ } ) ;
You can’t perform that action at this time.
0 commit comments