Start sending periodic pings to keep the connection alive
(self)
| 1304 | return max(3 * self.ping_interval, 30) |
| 1305 | |
| 1306 | def start_pinging(self) -> None: |
| 1307 | """Start sending periodic pings to keep the connection alive""" |
| 1308 | assert self.ping_interval is not None |
| 1309 | if self.ping_interval > 0: |
| 1310 | self.last_ping = self.last_pong = IOLoop.current().time() |
| 1311 | self.ping_callback = PeriodicCallback( |
| 1312 | self.periodic_ping, self.ping_interval * 1000 |
| 1313 | ) |
| 1314 | self.ping_callback.start() |
| 1315 | |
| 1316 | def periodic_ping(self) -> None: |
| 1317 | """Send a ping to keep the websocket alive |
no test coverage detected