def send_message(self, message):
"""
Internal. Sends the actual message from a queue entry.
"""
if not self.connected:
return False
message['_sending'] = True
msg = msgpack.packb(message, default=invalid_json_values)
try:
self.ssh_stream_stdin.write(msg)
message['_sent'] = True
self.ssh_stream_stdin.flush()
return len(msg)
except KeyboardInterrupt:
if message['_sent']:
return len(msg)
return False
except Exception as error:
self.connection_error(error)
return False
评论列表
文章目录