javascript - Where is the `listen` Function in Node.js Defined -
i'm poking around node.js internals, , came across following method definition
//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); };
within socket object's listen
method, there's call (seemingly) global function, named listen
.
listen(self, null, null, null);
where javascript method/function defined? i've scoured javascript files in code-base , can't seem find it.
(there's no specific task i'm trying accomplish here, other tracing node's execution path , trying understand patterns in use deep in system.)
it's defined farther down in net.js
. of 0.11.5, it's @ line 1089:
function listen(self, address, port, addresstype, backlog, fd) { if (!cluster) cluster = require('cluster'); if (cluster.ismaster) { self._listen2(address, port, addresstype, backlog, fd); return; } // ... }
Comments
Post a Comment