Browse Source

Update node_net.cc to make us of node_constants.cc

also affects dgram which uses a constant from node_net.cc
v0.7.4-release
Micheil Smith 14 years ago
committed by Ryan Dahl
parent
commit
8da020d39e
  1. 5
      lib/dgram.js
  2. 9
      lib/net.js
  3. 9
      src/node_net.cc

5
lib/dgram.js

@ -5,10 +5,13 @@ var dns = require('dns');
var IOWatcher = process.binding('io_watcher').IOWatcher;
var binding = process.binding('net');
var constants = process.binding('constants');
var socket = binding.socket;
var recvfrom = binding.recvfrom;
var close = binding.close;
var ENOENT = binding.ENOENT;
var ENOENT = constants.ENOENT;
function isPort (x) { return parseInt(x) >= 0; }
var pool = null;

9
lib/net.js

@ -25,6 +25,7 @@ var FreeList = require('freelist').FreeList;
var IOWatcher = process.binding('io_watcher').IOWatcher;
var Timer = process.binding('timer').Timer;
var constants = process.binding('constants');
var assert = process.assert;
var socket = binding.socket;
@ -44,9 +45,11 @@ var getsockname = binding.getsockname;
var errnoException = binding.errnoException;
var sendMsg = binding.sendMsg;
var recvMsg = binding.recvMsg;
var EINPROGRESS = binding.EINPROGRESS;
var ENOENT = binding.ENOENT;
var EMFILE = binding.EMFILE;
var EINPROGRESS = constants.EINPROGRESS;
var ENOENT = constants.ENOENT;
var EMFILE = constants.EMFILE;
var END_OF_FILE = 42;
var SecureContext, SecureStream; // lazy loaded

9
src/node_net.cc

@ -1322,15 +1322,6 @@ void InitNet(Handle<Object> target) {
NODE_SET_METHOD(target, "isIP", IsIP);
NODE_SET_METHOD(target, "errnoException", CreateErrnoException);
target->Set(String::NewSymbol("ENOENT"), Integer::New(ENOENT));
target->Set(String::NewSymbol("EMFILE"), Integer::New(EMFILE));
target->Set(String::NewSymbol("EINPROGRESS"), Integer::New(EINPROGRESS));
target->Set(String::NewSymbol("EINTR"), Integer::New(EINTR));
target->Set(String::NewSymbol("EACCES"), Integer::New(EACCES));
target->Set(String::NewSymbol("EPERM"), Integer::New(EPERM));
target->Set(String::NewSymbol("EADDRINUSE"), Integer::New(EADDRINUSE));
target->Set(String::NewSymbol("ECONNREFUSED"), Integer::New(ECONNREFUSED));
errno_symbol = NODE_PSYMBOL("errno");
syscall_symbol = NODE_PSYMBOL("syscall");
fd_symbol = NODE_PSYMBOL("fd");

Loading…
Cancel
Save