MessageEntry (Python)
When receive(), fetch(), or listen() methods return a payload, they return a MessageEntry object. If no payload is available, they return None.
Attributes​
| Attribute | Type | Description |
|---|---|---|
source | str | Identifier of the original sending application client |
destination | str | Identifier of the intended receiving application client |
payload | bytes | The raw payload bytes |
payload_size | int | The original size of the payload in bytes |
Example​
entry = nsb_conn.receive()
if entry:
print(f"Source: {entry.source}")
print(f"Destination: {entry.destination}")
print(f"Payload size: {entry.payload_size}")
print(f"Payload: {entry.payload}")
Go Deeper​
- NSBAppClient —
receive()returns this object - NSBSimClient —
fetch()returns this object - C++ MessageEntry — the equivalent struct in C++