Valentin Barral Valentin Barral - 1 year ago 184
Node.js Question

What is the difference between net.connect and net.createConnection in node.js?

I was reading the documentation from the net module in Node.js and I can't see any difference between the methods


Are they exactly the same or is there is some difference?

Answer Source

There's no difference. Here's an extract from the source code:

exports.connect = exports.createConnection = function() {

I agree the documentation isn't clear on that point.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download