From 61af4207dae4e43aa16f17c77b34391bb1e3da5b Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Mon, 7 Feb 2011 23:39:36 +0100 Subject: Fix dns on windows --- lib/dns.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') 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; } -- cgit v1.2.3