I get this error:
Error: accept EMFILE at errnoException (net.js:769:11) at TCP.onconnection (net.js:1017:24)
from a node.js app. Can I get a line number of my code that calls TCP.onconnection in the first place?
No you can't, because your code isn't calling
TCP.onconnection. That's an event handler, so an event is triggering it. This is one of the reasons event-based programming is difficult to debug.
I think you'll have some luck looking into what that error means, though. Some searching reveals that you're hitting a file descriptor limit, which can probably be increased (but that would be OS-dependent, so I can't tell you how without more info).
This recipe can be found in it's original form on Stack Over Flow.