poli.core.util.inter_process_communication.process_wrapper.get_connection

poli.core.util.inter_process_communication.process_wrapper.get_connection#

poli.core.util.inter_process_communication.process_wrapper.get_connection(port: int, password: str) Client#

Get a connection to a server.

Parameters
  • port (int) – The port number to connect to.

  • password (str) – The password for authentication.

Returns

The client object representing the connection to the server.

Return type

Client

Raises
  • EOFError – If the host process is not ready yet.

  • ConnectionRefusedError – If the connection is refused by the server.

Notes

This function attempts to establish a connection to a server using the given port and password. It retries the connection up to two times before raising an exception.