samsung-tv-control
samsung-tv-control copied to clipboard
sendKeyPromise() causes application to never exit
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.
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.
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