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)[source]
append_command(cmd: str, flush=False)[source]
append_dict(data: dict, flush=False)[source]
append_error(data: str, flush=False)[source]
append_shutdown(msg: str, flush=False)[source]
append_string(data: str, flush=False)[source]
append_success(data: str, flush=False)[source]
append_table(headers: List[str]) Table[source]
append_token(token: str, flush=False)[source]
close()[source]
flush()[source]
receive_and_process(sock, process_json_func)[source]

Receives and sends lines to process with process_json_func.

receive_til_end(sock, end='\x04')[source]