"""Invoked when the response to a ping frame is received."""
pass
+ def on_ping(self, data):
+ """Invoked when the a ping frame is received."""
+ pass
+
def on_close(self):
"""Invoked when the WebSocket is closed.
elif opcode == 0x9:
# Ping
self._write_frame(True, 0xA, data)
+ self._run_callback(self.handler.on_ping, data)
elif opcode == 0xA:
# Pong
self._run_callback(self.handler.on_pong, data)
def on_pong(self, data):
pass
+ def on_ping(self, data):
+ pass
+
def get_websocket_protocol(self):
return WebSocketProtocol13(self, mask_outgoing=True,
compression_options=self.compression_options)