anthonywebb / homebridge-cbus

CBus plugin for homebridge
MIT License
35 stars 20 forks source link

Recover from failed socket connection #14

Closed anthonywebb closed 7 years ago

anthonywebb commented 7 years ago

The other day, for some reason the socket between cgate-client.js and my cgate server failed. When that happens, the client will log errors, but we dont yet have any way to recover/recycle the connection again. This would be a nice addition.

I am attaching some screenshots of what my logs look like when I did hit that failed socket. Once the socket was failed anything I would try to do over that socket was failing and being logged.

screen shot 2017-01-12 at 10 04 47 am screen shot 2017-01-12 at 10 05 18 am

simonhac commented 7 years ago

@anthonywebb i'm sure there is a better way of doing this, but in the meantime, this should work:

simonhac commented 7 years ago

@anthonywebb i'm in this code, so i'm happy to look into this.

simonhac commented 7 years ago

@anthonywebb i'm enjoying using template literals from ES6. do you know if there is any issue with using ES6 language features and nodejs? (ie. can i expect that all nodejs runtime instances will support ES6?)

(i'm very new to this, but i can see from node.green that template literals have worked in node.js since v5.11.1, which was released 2016-05-05.)

simonhac commented 7 years ago

@anthonywebb please assign me to this (or let me know how i can assign myself).

anthonywebb commented 7 years ago

@simonhac it wont let me officiall assign you for some reason. Feel free to take it on though! 👍

simonhac commented 7 years ago

thanks @anthonywebb -- i'm new to this, but i think this article explains how to assign to me.

simonhac commented 7 years ago

fixed in v0.5.8 (PR #27)