yyagl.engine.network package

Submodules

yyagl.engine.network.binary module

class yyagl.engine.network.binary.BinaryData[source]

Bases: object

static pack(lst)[source]
static unpack(data)[source]
static unpack_helper(fmt, data)[source]

yyagl.engine.network.client module

class yyagl.engine.network.client.Client(port, srv_addr)[source]

Bases: yyagl.engine.network.network.AbsNetwork

register_rpc(funcname)[source]
send_udp(data_lst, sender)[source]
start(read_cb)[source]
unregister_rpc(funcname)[source]
class yyagl.engine.network.client.ClientThread(srv_addr, eng, port)[source]

Bases: yyagl.engine.network.network.NetworkThread

do_rpc(funcname, *args, **kwargs)[source]
send_msg(msg, receiver=None)[source]

yyagl.engine.network.network module

class yyagl.engine.network.network.AbsNetwork(port)[source]

Bases: yyagl.gameobject.GameObject

destroy()[source]
property is_active
on_frame()[source]
on_udp_pck(dgram, conn)[source]
process_udp()[source]
rate = 0.1
register_cb(callback)[source]
send(data_lst, receiver=None)[source]
start(read_cb)[source]
stop()[source]
exception yyagl.engine.network.network.ConnectionError[source]

Bases: Exception

class yyagl.engine.network.network.NetworkThread(eng, port)[source]

Bases: threading.Thread

destroy()[source]
recv_one_msg(sock)[source]
static recvall(sock, cnt)[source]
run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

yyagl.engine.network.server module

class yyagl.engine.network.server.Server(port)[source]

Bases: yyagl.engine.network.network.AbsNetwork

property connections
on_connected(conn)[source]
on_disconnected(conn)[source]
on_udp_pck(dgram, conn)[source]
process_udp()[source]
register_rpc(func)[source]
rpc_cb(funcname, args, kwargs, conn)[source]
send(data_lst, receiver=None)[source]
send_udp(data_lst, receiver)[source]
start(read_cb, conn_cb)[source]
unregister_rpc(func)[source]
class yyagl.engine.network.server.ServerThread(eng, rpc_cb, port)[source]

Bases: yyagl.engine.network.network.NetworkThread, yyagl.gameobject.GameObject

send_msg(conn, msg)[source]

Module contents