nvflare.fuel.f3.sfm.sfm_conn module¶
- class SfmConnection(conn: Connection, local_endpoint: Endpoint)[source]¶
Bases:
object
A wrapper of driver connection.
Driver connection deals with frame. This connection handles messages.
The frame format:
+--------------------------------------------------------+ | length (4 bytes) | +----------------------------+---------------------------+ | header_len (2) | type (1) | reserved | +----------------------------+---------------------------+ | flags (2) | app_id (2) | +----------------------------+---------------------------+ | stream_id (2) | sequence (2) | +--------------------------------------------------------+ | Headers | | header_len bytes | +--------------------------------------------------------+ | | | Payload | | (length-header_len-16) bytes | | | +--------------------------------------------------------+
- next_sequence() int [source]¶
Get next sequence number for the connection.
Sequence is used to detect lost frames.
- send_data(app_id: int, stream_id: int, headers: Headers, payload: bytes | bytearray | memoryview)[source]¶
Send user data