()
| 522 | s.on('close', onClose); |
| 523 | |
| 524 | function onTimeout() { |
| 525 | debug('CLIENT socket onTimeout'); |
| 526 | |
| 527 | // Destroy if in free list. |
| 528 | // TODO(ronag): Always destroy, even if not in free list. |
| 529 | const sockets = agent.freeSockets; |
| 530 | if (ObjectKeys(sockets).some((name) => sockets[name].includes(s))) { |
| 531 | return s.destroy(); |
| 532 | } |
| 533 | } |
| 534 | s.on('timeout', onTimeout); |
| 535 | |
| 536 | function onRemove() { |