lib.connection

This library is on its way out. Network classes for SmartHomeNG are provided by lib.network. Creating lib.connection Server and Client class object will create an appropriate WARNING log entry.

The following modules use an import lib.connection as of December 2021: smarthome.py for an object of Connections() Plugins: visu_websocket

class lib.connection.Base(monitor=False)[Quellcode]

Bases: object

provides same base class for class Connections(), class Server(), class Stream() and thus also to class Client() which inherits from Stream()

some lookup dicts for protocol family like TCP or UDP flavours and the like for protocol type

class lib.connection.Client(host, port, proto='TCP', monitor=False)[Quellcode]

Bases: Stream

connect()[Quellcode]
class lib.connection.Connections[Quellcode]

Bases: Base

Within SmartHome.py there is one instance of this class

The filenumber of a connection is the key to the contained dicts of _connections and _servers Additionally the filenumber is used for either epoll or kqueue depending on the environment found for select. A filenumber of value -1 is an error value.

check()[Quellcode]
close()[Quellcode]
monitor(obj)[Quellcode]
poll()[Quellcode]
register_connection(fileno, obj)[Quellcode]
register_server(fileno, obj)[Quellcode]
trigger(fileno)[Quellcode]
unregister_connection(fileno)[Quellcode]
class lib.connection.Server(host, port, proto='TCP')[Quellcode]

Bases: Base

accept()[Quellcode]
close()[Quellcode]
connect()[Quellcode]
handle_connection()[Quellcode]
class lib.connection.Stream(sock=None, address=None, monitor=False)[Quellcode]

Bases: Base

balance(bopen, bclose)[Quellcode]
close()[Quellcode]
discard_buffers()[Quellcode]
found_balance(data)[Quellcode]
found_terminator(data)[Quellcode]
handle_close()[Quellcode]
handle_connect()[Quellcode]
send(data, close=False)[Quellcode]