leads.comm.client.client#

Module Contents#

Classes#

Client

You should use create_client() and start_client() instead of directly calling any method.

API#

class leads.comm.client.client.Client(port: int, callback: leads.comm.prototype.Callback, separator: bytes)[source]#

Bases: leads.comm.prototype.Entity

You should use create_client() and start_client() instead of directly calling any method.

Initialization

Parameters:
  • port – the port to which the client connects

  • callback – the callback interface

  • separator – the symbol that splits the stream into messages

run(server_address: str) None[source]#

Establish a connection and stage it. :param server_address: the server address to which the client connects

send(msg: bytes) None[source]#

Send the message to the server. :param msg: the message to send :exception IOError: no connection

close() None[source]#

Close the connection.