bricknil.sockets

Experimental socket updates of devices and hubs

Classes

WebClient(client, addr, in_queue) Represents a client that has connected to BrickNil’s server
WebMessage(hub) Handles message conversion into JSON and transmission

Functions

bricknil_socket_server(web_out_queue, address) Listen for client connections on port 25000 and spawn WebClient instance.

Members

class bricknil.sockets.WebClient(client, addr, in_queue)[source]

Bases: object

Represents a client that has connected to BrickNil’s server

Each client has a connection to the global BrickNil curio.Queue that handles broadcast messages about peripherals. Peripherals insert the messages into the queue, and clients can read from it (hence why it’s called in_queue in this class).

run()[source]
class bricknil.sockets.WebMessage(hub)[source]

Bases: object

Handles message conversion into JSON and transmission

send(peripheral, msg)[source]
bricknil.sockets.bricknil_socket_server(web_out_queue, address)[source]

Listen for client connections on port 25000 and spawn WebClient instance. This fuction is spawned as a task during system instantiation in bricknil.bricknil._run_all`()