Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-09-13 01:59:51 +0400
committerRyan Dahl <ry@tinyclouds.org>2011-09-13 02:09:44 +0400
commitcaaa59c559f4ed8b26ab1438f4104f4e93adb098 (patch)
tree75fc658a6b126d597985dc0ac05e6333a4b8f391 /src/pipe_wrap.cc
parent51f2e8439e4e26f7f3b58193112916c711085c91 (diff)
Wrap uv_pipe_open, implement net.Stream(fd);
Fixes simple/test-child-process-ipc on unix.
Diffstat (limited to 'src/pipe_wrap.cc')
-rw-r--r--src/pipe_wrap.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc
index 247d715df64..f8a8c84990f 100644
--- a/src/pipe_wrap.cc
+++ b/src/pipe_wrap.cc
@@ -70,6 +70,7 @@ void PipeWrap::Initialize(Handle<Object> target) {
NODE_SET_PROTOTYPE_METHOD(t, "bind", Bind);
NODE_SET_PROTOTYPE_METHOD(t, "listen", Listen);
NODE_SET_PROTOTYPE_METHOD(t, "connect", Connect);
+ NODE_SET_PROTOTYPE_METHOD(t, "open", Open);
pipeConstructor = Persistent<Function>::New(t->GetFunction());
@@ -195,6 +196,19 @@ void PipeWrap::AfterConnect(uv_connect_t* req, int status) {
}
+Handle<Value> PipeWrap::Open(const Arguments& args) {
+ HandleScope scope;
+
+ UNWRAP
+
+ int fd = args[0]->IntegerValue();
+
+ uv_pipe_open(&wrap->handle_, fd);
+
+ return scope.Close(v8::Null());
+}
+
+
Handle<Value> PipeWrap::Connect(const Arguments& args) {
HandleScope scope;