ez_client module¶
- 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