pymasep.communication.client

Classes

Client

Base class for Client

Module Contents

class pymasep.communication.client.Client(ident, socket_handler_class, socket_handler_args, host=None, port=None, log_level=logging.WARNING)

Bases: pymasep.communication.BaseThreadedCommunication

Base class for Client

Parameters:
  • ident (str) – string id of the client.

  • host (str) – Host to connect. If None, the client will search a server to connect to.

  • port (int) – Port to connect. If None, the client will search a server to connect to.

  • socket_handler_class (Type[Any]) – Class used to handle the socket (send, receive).

  • socket_handler_args (tuple) – Arguments to instantiate the SocketHandler class.

  • log_level (Union[str, int]) – Log level messages to log as str or int. Default is logging.WARNING.

server_id = None

id of the server to connect to

__del__()

Delete the instance. Close the socket

connect()

Connect the client to a server. Create the handler and register the connection.

search_server()

Search a server on the local net using multicast UPD