nvflare.fuel.f3.connection module

class ConnState(value)[source]

Bases: Enum

An enumeration.

CLOSED = 3
CONNECTED = 2
IDLE = 1
class Connection(connector: ConnectorInfo)[source]

Bases: ABC

FCI connection spec. A connection is used to transfer opaque frames

abstract close()[source]

Close connection

Raises:

CommError – If any errors

abstract get_conn_properties() dict[source]

Get connection specific properties, like peer address, TLS certificate etc

Raises:

CommError – If any errors

process_frame(frame: bytes | bytearray | memoryview | list)[source]

A convenience function to call frame receiver

Parameters:

frame – The frame to be processed

Raises:

CommError – If any error happens while processing the frame

register_frame_receiver(receiver: FrameReceiver)[source]

Register frame receiver

Parameters:

receiver – The frame receiver

abstract send_frame(frame: bytes | bytearray | memoryview | list)[source]

Send a SFM frame through the connection to the remote endpoint.

Parameters:

frame – The frame to be sent

Raises:

CommError – If any error happens while sending the frame

class FrameReceiver[source]

Bases: ABC

abstract process_frame(frame: bytes | bytearray | memoryview | list)[source]

Frame received callback

Parameters:

frame – The frame received

Raises:

CommError – If any error happens while processing the frame

create_connection_name()[source]