Write a message to socket (sync). Args: sock: Socket to write to message: Message dict with 'type', 'id', and payload fields Raises: DirtyProtocolError: If encoding fails OSError: If write fails
(sock: socket.socket, message: dict)
| 558 | |
| 559 | @staticmethod |
| 560 | def write_message(sock: socket.socket, message: dict) -> None: |
| 561 | """ |
| 562 | Write a message to socket (sync). |
| 563 | |
| 564 | Args: |
| 565 | sock: Socket to write to |
| 566 | message: Message dict with 'type', 'id', and payload fields |
| 567 | |
| 568 | Raises: |
| 569 | DirtyProtocolError: If encoding fails |
| 570 | OSError: If write fails |
| 571 | """ |
| 572 | data = BinaryProtocol._encode_from_dict(message) |
| 573 | sock.sendall(data) |
| 574 | |
| 575 | @staticmethod |
| 576 | def _encode_from_dict(message: dict) -> bytes: # pylint: disable=too-many-return-statements |
no test coverage detected