ez_client module

Inheritance diagram of ez_client

class ez_client.client(fail_connect=False, **kwargs)[source]

Bases: ez_process.ez_process, ez_simple_cli.ez_simple_cli, threading.Thread

Client class with builtin queue system, p2p via NAT traversal and reliable udp packet system.

Commands are executed by appending p2pCommand instances to the client commandQueue.

Most commands are not intended to be called by the user himself, but are usually automatically called as a consequence of connection, ping or packet requests.

Queue commands are defined in ez_process. The client takes care of input (IO + incomming msges), the user db and pulling commands/results from the queues.

receive(cmd)[source]

The receive function supports 3 types of data:

  • Dictionaries with p2pCommand keys and appropriate arguments as values
  • Message instances
  • Raw printable data

UDP packets must be pickled otherwise the data is rejected

run()[source]

client main loop: Processes all queued commands. The timeout (0.1) is set in order to allow checking self.alive

set_acception_rules(**acception_rules)[source]
ez_client.init_client(name, **kwargs)[source]