summaryrefslogtreecommitdiff
path: root/src/udp_wrap.cc
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-12-22 13:40:26 -0800
committerBen Noordhuis <info@bnoordhuis.nl>2011-12-29 01:56:11 +0100
commit20ba454ef9e8ff2bb19abb26f9b95265beb98e11 (patch)
tree484b3a5d4ab97897012ef1e768af9e9ea424600a /src/udp_wrap.cc
parentdd0188ec088fc87ee689e4efa193e241199de615 (diff)
downloadnode-20ba454ef9e8ff2bb19abb26f9b95265beb98e11.tar.gz
Add node::Loop() and don't inc node_isolate.h in *.cc
node::Loop() replaces the NODE_LOOP macro. This avoids hitting v8::Isolate::GetCurrent() for each loop lookup when HAVE_ISOLATE==0
Diffstat (limited to 'src/udp_wrap.cc')
-rw-r--r--src/udp_wrap.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc
index f0c487ece..dce45ada4 100644
--- a/src/udp_wrap.cc
+++ b/src/udp_wrap.cc
@@ -21,7 +21,7 @@
#include <node.h>
#include <node_buffer.h>
-#include <node_isolate.h>
+#include <node_vars.h>
#include <req_wrap.h>
#include <handle_wrap.h>
@@ -104,7 +104,7 @@ private:
UDPWrap::UDPWrap(Handle<Object> object): HandleWrap(object,
(uv_handle_t*)&handle_) {
- int r = uv_udp_init(NODE_LOOP(), &handle_);
+ int r = uv_udp_init(Loop(), &handle_);
assert(r == 0); // can't fail anyway
handle_.data = reinterpret_cast<void*>(this);
}
@@ -177,7 +177,7 @@ Handle<Value> UDPWrap::DoBind(const Arguments& args, int family) {
}
if (r)
- SetErrno(uv_last_error(NODE_LOOP()));
+ SetErrno(uv_last_error(Loop()));
return scope.Close(Integer::New(r));
}
@@ -234,7 +234,7 @@ Handle<Value> UDPWrap::DoSend(const Arguments& args, int family) {
req_wrap->Dispatched();
if (r) {
- SetErrno(uv_last_error(NODE_LOOP()));
+ SetErrno(uv_last_error(Loop()));
delete req_wrap;
return Null();
}
@@ -261,8 +261,8 @@ Handle<Value> UDPWrap::RecvStart(const Arguments& args) {
// UV_EALREADY means that the socket is already bound but that's okay
int r = uv_udp_recv_start(&wrap->handle_, OnAlloc, OnRecv);
- if (r && uv_last_error(NODE_LOOP()).code != UV_EALREADY) {
- SetErrno(uv_last_error(NODE_LOOP()));
+ if (r && uv_last_error(Loop()).code != UV_EALREADY) {
+ SetErrno(uv_last_error(Loop()));
return False();
}
@@ -298,7 +298,7 @@ Handle<Value> UDPWrap::GetSockName(const Arguments& args) {
return scope.Close(sockname);
}
else {
- SetErrno(uv_last_error(NODE_LOOP()));
+ SetErrno(uv_last_error(Loop()));
return Null();
}
}
@@ -317,7 +317,7 @@ void UDPWrap::OnSend(uv_udp_send_t* req, int status) {
assert(wrap->object_.IsEmpty() == false);
if (status) {
- SetErrno(uv_last_error(NODE_LOOP()));
+ SetErrno(uv_last_error(Loop()));
}
Local<Value> argv[4] = {
@@ -365,7 +365,7 @@ void UDPWrap::OnRecv(uv_udp_t* handle,
};
if (nread == -1) {
- SetErrno(uv_last_error(NODE_LOOP()));
+ SetErrno(uv_last_error(Loop()));
}
else {
Local<Object> rinfo = Object::New();