Browse Source

wrap: upgrade pipe_wrap and tcp_wrap to new libuv API

v0.7.4-release
Ben Noordhuis 14 years ago
parent
commit
83b82f900f
  1. 4
      src/pipe_wrap.cc
  2. 4
      src/tcp_wrap.cc

4
src/pipe_wrap.cc

@ -111,7 +111,7 @@ class PipeWrap : StreamWrap {
int backlog = args[0]->Int32Value();
int r = uv_pipe_listen(&wrap->handle_, OnConnection);
int r = uv_listen((uv_stream_t*)&wrap->handle_, backlog, OnConnection);
// Error starting the pipe.
if (r) SetErrno(uv_last_error().code);
@ -120,7 +120,7 @@ class PipeWrap : StreamWrap {
}
// TODO maybe share with TCPWrap?
static void OnConnection(uv_handle_t* handle, int status) {
static void OnConnection(uv_stream_t* handle, int status) {
HandleScope scope;
PipeWrap* wrap = static_cast<PipeWrap*>(handle->data);

4
src/tcp_wrap.cc

@ -196,7 +196,7 @@ class TCPWrap : public StreamWrap {
int backlog = args[0]->Int32Value();
int r = uv_tcp_listen(&wrap->handle_, backlog, OnConnection);
int r = uv_listen((uv_stream_t*)&wrap->handle_, backlog, OnConnection);
// Error starting the tcp.
if (r) SetErrno(uv_last_error().code);
@ -204,7 +204,7 @@ class TCPWrap : public StreamWrap {
return scope.Close(Integer::New(r));
}
static void OnConnection(uv_handle_t* handle, int status) {
static void OnConnection(uv_stream_t* handle, int status) {
HandleScope scope;
TCPWrap* wrap = static_cast<TCPWrap*>(handle->data);

Loading…
Cancel
Save