(req, options, cb)
| 26034 | return super.getName(options); |
| 26035 | } |
| 26036 | createSocket(req, options, cb) { |
| 26037 | const connectOpts = { |
| 26038 | ...options, |
| 26039 | secureEndpoint: this.isSecureEndpoint(options) |
| 26040 | }; |
| 26041 | const name = this.getName(connectOpts); |
| 26042 | const fakeSocket = this.incrementSockets(name); |
| 26043 | Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => { |
| 26044 | this.decrementSockets(name, fakeSocket); |
| 26045 | if (socket instanceof http4.Agent) { |
| 26046 | try { |
| 26047 | return socket.addRequest(req, connectOpts); |
| 26048 | } catch (err) { |
| 26049 | return cb(err); |
| 26050 | } |
| 26051 | } |
| 26052 | this[INTERNAL2].currentSocket = socket; |
| 26053 | super.createSocket(req, options, cb); |
| 26054 | }, (err) => { |
| 26055 | this.decrementSockets(name, fakeSocket); |
| 26056 | cb(err); |
| 26057 | }); |
| 26058 | } |
| 26059 | createConnection() { |
| 26060 | const socket = this[INTERNAL2].currentSocket; |
| 26061 | this[INTERNAL2].currentSocket = void 0; |
nothing calls this directly
no test coverage detected