feat(connector.py): add Connector.send() method

This commit is contained in:
2025-11-19 21:53:08 +01:00
parent 99e94e2f5a
commit 5458281186

View File

@@ -89,6 +89,17 @@ class Connector:
self.logger.error(f"[!] Socket error: {e}")
self.reconnect()
def send(self, message: Message) -> None:
"""Send a message to the server.
Args:
message (Message): The message to send.
"""
self.logger.debug(f"[>] Queueing message to send: {message}")
if message.ack_required:
self.pending_acks[message.id] = (message, time.time())
self.outbound_buffer += message.to_bytes()
def send_hello(self) -> None:
"""Send a HELLO message to the server."""
self.logger.debug("[*] Sending HELLO message...")