MCPcopy Create free account
hub / github.com/EasyIME/PIME / ping

Method ping

python/python3/tornado/websocket.py:1534–1551  ·  view source on GitHub ↗

Send ping frame to the remote end. The data argument allows a small amount of data (up to 125 bytes) to be sent as a part of the ping message. Note that not all websocket implementations expose this data to applications. Consider using the ``ping_interval``

(self, data: bytes = b"")

Source from the content-addressed store, hash-verified

1532 return self.read_queue.put(message)
1533
1534 def ping(self, data: bytes = b"") -> None:
1535 """Send ping frame to the remote end.
1536
1537 The data argument allows a small amount of data (up to 125
1538 bytes) to be sent as a part of the ping message. Note that not
1539 all websocket implementations expose this data to
1540 applications.
1541
1542 Consider using the ``ping_interval`` argument to
1543 `websocket_connect` instead of sending pings manually.
1544
1545 .. versionadded:: 5.1
1546
1547 """
1548 data = utf8(data)
1549 if self.protocol is None:
1550 raise WebSocketClosedError()
1551 self.protocol.write_ping(data)
1552
1553 def on_pong(self, data: bytes) -> None:
1554 pass

Callers

nothing calls this directly

Calls 3

utf8Function · 0.90
write_pingMethod · 0.45

Tested by

no test coverage detected