net: use connect() instead of connect.call()

Use socket.connect() directly.

PR-URL: https://github.com/nodejs/node/pull/23289
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Thomas Watson <w@tson.dk>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Jackson Tian 2018-10-06 20:09:58 +08:00 committed by Daniel Bevenius
parent d2de8291fb
commit 45c70b0ce7

View File

@ -152,7 +152,7 @@ function connect(...args) {
socket.setTimeout(options.timeout);
}
return Socket.prototype.connect.call(socket, normalized);
return socket.connect(normalized);
}