nvflare.fuel.hci.conn module

class Connection(sock, server)[source]

Bases: BaseContext

Object containing connection information and buffer to build and send a line with socket passed in at init.

Parameters:
  • sock – sock for the connection

  • server – server for the connection

append_any(data, flush=False, meta: dict | None = None)[source]
append_command(cmd: str, flush=False)[source]
append_dict(data: dict, flush=False, meta: dict | None = None)[source]
append_error(data: str, flush=False, meta: dict | None = None)[source]
append_shutdown(msg: str, flush=False)[source]
append_string(data: str, flush=False, meta: dict | None = None)[source]
append_success(data: str, flush=False, meta: dict | None = None)[source]
append_table(headers: List[str], name=None) Table[source]
append_token(token: str, flush=False)[source]
close()[source]
flush()[source]
flush_bytes(data)[source]
update_meta(meta: dict)[source]
receive_and_process(sock, process_json_func)[source]

Receives and sends lines to process with process_json_func.

receive_bytes_and_process(sock, receiver)[source]