JakeBednard / node-phea

An unoffcial Phillips Hue Entertainment API library for Node.js
MIT License
32 stars 8 forks source link

Don't throw error when closing socket #3

Open ledge74 opened 5 years ago

ledge74 commented 5 years ago

Hi,

First I got phea working and it's awesome, thank you for making it 😃

I'm building an API that will be able start / stop entertainment sync. However, Phea throws an error when I'm closing a stream using phea.stop().

Is there any particular reason I'm not understanding for throwing an error when stopping a stream ?

Related code is the following https://github.com/JakeBednard/node-phea/blob/101dd6205f3ed7ac3f4c4113984a2e708c91e442/src/hue-controller.js#L142-L146

Thanks

JakeBednard commented 4 years ago

Hi Ledge,

Sorry for the (months) delay in getting back with you. Today I released 1.0.0 which has been a pretty large re-write to Typescript. I've updated the documentation as well as pushed to NPM. I've been hesitant to release it as its mostly a re-write, but it now feels stable. Give it a try if you have some time.

As far as the stream close error, yeah I'm going to prioritize this now. This is the last glaring bug from the prior code. If I recall, there was some sort of complication, but I think the codebase is better to handle it now.

I'll give you a comment when I get it worked out (hopefully today/tomorrow). I'll close your other issue as well and point to this one.

Thanks.

JakeBednard commented 4 years ago

I have commented out the error throwing from dtlsSocket.close(). There might be some sideeffects to this on startup (i.g. Socket may fail to open on startup, but program doesn't check state and continues to run). I'll work this out during testing.

Repo + NPM Updated to "1.0.2"

JakeBednard commented 4 years ago

Tagged #7 wasn't related to the issue. Still keeping this open until I can address maintaining socket state.