Monday, 19 August 2013

Where is the `listen` Function in Node.js Defined

Where is the `listen` Function in Node.js Defined

pI'm poking around the Node.js internals, and I came across the following
method definition/p precode//File: node/lib/net.js Socket.prototype.listen
= function() { debug('socket.listen'); var self = this;
self.on('connection', arguments[0]); listen(self, null, null, null); };
/code/pre pWithin the Socket object's codelisten/code method, there's a
call to a (seemingly) global function, also named codelisten/code. /p
precodelisten(self, null, null, null); /code/pre pWhere is this javascript
method/function defined? I've scoured all the javascript files in the
code-base and can't seem to find it. /p p(There's no specific task I'm
trying to accomplish here, other than tracing node's execution path and
trying to understand the patterns in use deep in the system.)/p

No comments:

Post a Comment