samsung-tv-control icon indicating copy to clipboard operation
samsung-tv-control copied to clipboard

sendKeyPromise() causes application to never exit

Open matt328 opened this issue 2 years ago • 2 comments

Possibly I don't have my application configured correctly, but if I call control.sendKeyPromise(), the application never exits. Not sure if it keeps a websocket alive and node is detecting this or what, but the promise resolves and execution passes through the entirety of index.ts, just the process never exits.

Edit:

https://github.com/matt328/game-time/blob/main/src/index.ts#L28 is my repro.

matt328 avatar Jun 13 '22 01:06 matt328

I came to see if this issue was already reported. I'm using the latest version 1.12.4 and I think the conditional logic in the internal _sendKey() function isn't closing the WebSocket connection in every case it should. By the way it happens with the callback based version as well, sendKey().

I tried calling the closeConnection method in the callback or after the promise is resolved but as far I can see, the method is empty and it does nothing.

hurrikam avatar Jul 27 '22 13:07 hurrikam

yeah its an open handle issue, it keeps the connection open for some reason

and also Ive been wondering why I couldnt close it till i peeked at https://github.com/Toxblh/samsung-tv-control/blob/master/src/samsung.ts#L348

eisenwinter avatar Oct 21 '22 08:10 eisenwinter