uecho.frame package

Submodules

uecho.frame.interface module

class uecho.frame.interface.Interface

Bases: object

static get_all_ipaddrs() List[str]

uecho.frame.manager module

class uecho.frame.manager.Manager

Bases: object

add_observer(observer)
announce_message(msg: Message) bool
property ifaddr: str
notify(msg: Message)
property port: int
send_message(msg: Message, addr) bool
servers: List[Server]
start(ifaddrs: List[str] = []) bool
stop() bool

uecho.frame.multicast_server module

class uecho.frame.multicast_server.MulticastServer

Bases: Server

ADDRESS = '224.0.23.0'
bind(ifaddr: str) bool
ifaddr: str
port: int
sock: socket | None

uecho.frame.observer module

uecho.frame.server module

class uecho.frame.server.Server

Bases: Thread

PORT = 3610
add_observer(observer) bool

Adds a message observer to the subject.

Parameters:

Observer (observer) – A message observer.

Returns:

Returns True when the specified observer is added, Otherwise False.

Return type:

bool

bind(ifaddr: str) bool
create_udp_socket() socket
ifaddr: str
notify(msg: Message)

Notifies the specified message to the added observers.

Parameters:

msg (Message) – A notify message

port: int
run()

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.

sock: socket | None
start() Any

Start the thread’s activity.

It must be called at most once per thread object. It arranges for the object’s run() method to be invoked in a separate thread of control.

This method will raise a RuntimeError if called more than once on the same thread object.

stop() Any

uecho.frame.unicast_server module

class uecho.frame.unicast_server.UnicastServer

Bases: Server

announce_message(msg: Message) bool
bind(ifaddr: str) bool
ifaddr: str
port: int
send_message(msg: Message, addr: Tuple[str, int] | None) bool
sock: socket | None

Module contents

class uecho.frame.Interface

Bases: object

static get_all_ipaddrs() List[str]
class uecho.frame.Manager

Bases: object

add_observer(observer)
announce_message(msg: Message) bool
property ifaddr: str
notify(msg: Message)
property port: int
send_message(msg: Message, addr) bool
servers: List[Server]
start(ifaddrs: List[str] = []) bool
stop() bool