| 2835 | })); |
| 2836 | } |
| 2837 | if (options.keepAlive == null || options.keepAlive) { |
| 2838 | const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay; |
| 2839 | socket.setKeepAlive(true, keepAliveInitialDelay); |
| 2840 | } |
| 2841 | const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port }); |
| 2842 | socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() { |
| 2843 | queueMicrotask(clearConnectTimeout); |
| 2844 | if (callback) { |
| 2845 | const cb = callback; |
| 2846 | callback = null; |
| 2847 | cb(null, this); |
| 2848 | } |
| 2849 | }).on("error", function(err) { |