(socket)
| 9504 | } |
| 9505 | } |
| 9506 | keepSocketAlive(socket) { |
| 9507 | const result = super.keepSocketAlive(socket); |
| 9508 | if (!result) return result; |
| 9509 | const customTimeout = this.calcSocketTimeout(socket); |
| 9510 | if (typeof customTimeout === "undefined") { |
| 9511 | return true; |
| 9512 | } |
| 9513 | if (customTimeout <= 0) { |
| 9514 | debug5( |
| 9515 | "%s(requests: %s, finished: %s) free but need to destroy by TTL, request count %s, diff is %s", |
| 9516 | socket[SOCKET_NAME], |
| 9517 | socket[SOCKET_REQUEST_COUNT], |
| 9518 | socket[SOCKET_REQUEST_FINISHED_COUNT], |
| 9519 | customTimeout |
| 9520 | ); |
| 9521 | return false; |
| 9522 | } |
| 9523 | if (socket.timeout !== customTimeout) { |
| 9524 | socket.setTimeout(customTimeout); |
| 9525 | } |
| 9526 | return true; |
| 9527 | } |
| 9528 | // only call on addRequest |
| 9529 | reuseSocket(...args) { |
| 9530 | super.reuseSocket(...args); |
nothing calls this directly
no test coverage detected