var util = require("util");
-var fs = require("fs");
var events = require("events");
var stream = require("stream");
-var dns = require('dns');
var kMinPoolSpace = 128;
var kPoolSize = 40*1024;
doConnect(self, arguments[0]);
} else {
// TCP
- dns.lookup(arguments[1], function (err, ip, addressType) {
+ require('dns').lookup(arguments[1], function (err, ip, addressType) {
if (err) {
self.emit('error', err);
} else {
var path = arguments[0];
self.path = path;
// unlink sockfile if it exists
- fs.stat(path, function (err, r) {
+ require('fs').stat(path, function (err, r) {
if (err) {
if (err.errno == ENOENT) {
self._doListen(path);
self._doListen(port);
} else {
// the first argument is the port, the second an IP
- dns.lookup(arguments[1], function (err, ip, addressType) {
+ require('dns').lookup(arguments[1], function (err, ip, addressType) {
if (err) {
self.emit('error', err);
} else {
}
if (self.type === "unix") {
- fs.unlink(self.path, function () {
+ require('fs').unlink(self.path, function () {
self.emit("close");
});
} else {