lib.connection

This library is softly on it’s way out. In the future network classes for SmartHomeNG will be implemented trough the network library lib.network, which is still in development.

The following modules use an import lib.connection as of April 2018: smarthome.py for an object of Connections() Plugins: russound, network, visu_websocket, asterisk, knx, squeezebox, nuki, mpd, raumfeld, cli, speech, xbmc, lirc

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

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)[source]

Bases: lib.connection.Stream

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

Bases: lib.connection.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()[source]
close()[source]
monitor(obj)[source]
poll()[source]
register_connection(fileno, obj)[source]
register_server(fileno, obj)[source]
trigger(fileno)[source]
unregister_connection(fileno)[source]
class lib.connection.Server(host, port, proto='TCP')[source]

Bases: lib.connection.Base

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

Bases: lib.connection.Base

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