philip1986 / pimatic-led-light

A template for creating plugins
http://pimatic.org/
GNU General Public License v2.0
7 stars 13 forks source link

Wifi370 error messages #36

Open mwittig opened 8 years ago

mwittig commented 8 years ago

pimatic-led-light is producing lots of errors for me: error [pimatic-led-light]: [Error: write after end] and error [pimatic-led-light]: [Error: connection timeout]

See also https://github.com/philip1986/pimatic-led-light/issues/27

philip1986 commented 8 years ago

Maybe connection handling in the ["driver"]() needs to be refactored. Currently it establishes a new connection for each call. Might be better to go with a singleton pattern and reuse one connection.

mwittig commented 8 years ago

Agree, but synchronizing to a single connection can be tricky as it may introduce hidden "race conditions" caused depending on the ordering of events processed. I had to implement a single connection handling as part of pimatic-denon-avr as the AVR only accepts a single connection.

philip1986 commented 8 years ago

@mwittig yeah that is true