* Sets the ping timer (including clearing any previous one).
()
| 145 | * Sets the ping timer (including clearing any previous one). |
| 146 | */ |
| 147 | private setPingTimer(): void { |
| 148 | // if there's already an unacknowledged ping, we don't need to set up a timer for another to be sent |
| 149 | if (this.lastPing !== undefined) { |
| 150 | return; |
| 151 | } |
| 152 | |
| 153 | this.logger.debug('setting ping timer'); |
| 154 | |
| 155 | this.clearPreviousPingTimer(); |
| 156 | this.pingTimer = setTimeout(this.sendPing.bind(this), this.clientPingTimeout); |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Sends a ping and manages the timer to wait for a pong. |
no test coverage detected