def _sendPONG(self):
# Frames sent from client to server must be masked
self._sslSocket.write(self._encodeFrame("", self._OP_PONG, masked=1))
# Override sslSocket read. Always read from the wss internal payload buffer, which
# contains the masked MQTT packet. This read will decode ONE wss frame every time
# and load in the payload for MQTT _packet_read. At any time, MQTT _packet_read
# should be able to read a complete MQTT packet from the payload (buffered per wss
# frame payload). If the MQTT packet is break into separate wss frames, different
# chunks will be buffered in separate frames and MQTT _packet_read will not be able
# to collect a complete MQTT packet to operate on until the necessary payload is
# fully buffered.
# If the requested number of bytes are not available, SSL_ERROR_WANT_READ will be
# raised to trigger another call of _packet_read when the data is available again.
评论列表
文章目录