(self)
| 589 | return res |
| 590 | |
| 591 | def ping(self): |
| 592 | s = time.time() |
| 593 | response = None |
| 594 | with gevent.Timeout(10.0, False): |
| 595 | try: |
| 596 | response = self.request("ping") |
| 597 | except Exception as err: |
| 598 | self.log("Ping error: %s" % Debug.formatException(err)) |
| 599 | if response and "body" in response and response["body"] == b"Pong!": |
| 600 | self.last_ping_delay = time.time() - s |
| 601 | return True |
| 602 | else: |
| 603 | return False |
| 604 | |
| 605 | # Close connection |
| 606 | def close(self, reason="Unknown"): |
no test coverage detected