diff options
author | Bert Belder <bertbelder@gmail.com> | 2011-02-07 23:39:36 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-02-07 15:30:17 -0800 |
commit | 61af4207dae4e43aa16f17c77b34391bb1e3da5b (patch) | |
tree | d69329e43a4714120ba8d3ae6edd3f2cd2997770 /lib/dns.js | |
parent | 3ec030535c5a289cefbca7881da2554ef276253d (diff) | |
download | nodejs-61af4207dae4e43aa16f17c77b34391bb1e3da5b.tar.gz nodejs-61af4207dae4e43aa16f17c77b34391bb1e3da5b.tar.bz2 nodejs-61af4207dae4e43aa16f17c77b34391bb1e3da5b.zip |
Fix dns on windows
Diffstat (limited to 'lib/dns.js')
-rw-r--r-- | lib/dns.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/dns.js b/lib/dns.js index 8d7eef2a6..516c7c20c 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -33,7 +33,13 @@ function updateTimer() { var channel = new dns.Channel({SOCK_STATE_CB: function(socket, read, write) { - var watcher; + var watcher, fd; + + if (process.platform == 'win32') { + fd = process.binding('os').openOSHandle(socket); + } else { + fd = socket; + } if (socket in watchers) { watcher = watchers[socket].watcher; @@ -56,7 +62,7 @@ var channel = new dns.Channel({SOCK_STATE_CB: function(socket, read, write) { delete activeWatchers[socket]; return; } else { - watcher.set(socket, read == 1, write == 1); + watcher.set(fd, read == 1, write == 1); watcher.start(); activeWatchers[socket] = watcher; } |