Takes message data and adds a message header based on the operation. Returns the resultant message string.
(operation: int, data: bytes)
| 314 | |
| 315 | |
| 316 | def __pack_message(operation: int, data: bytes) -> tuple[int, bytes]: |
| 317 | """Takes message data and adds a message header based on the operation. |
| 318 | |
| 319 | Returns the resultant message string. |
| 320 | """ |
| 321 | rid = _randint() |
| 322 | message = _pack_header(16 + len(data), rid, 0, operation) |
| 323 | return rid, message + data |
| 324 | |
| 325 | |
| 326 | _pack_int = struct.Struct("<i").pack |
no test coverage detected