Supergiovane / node-red-contrib-sonospollytts

Play speech TTS using Sonos.
https://www.facebook.com/supergiovaneDev
MIT License
12 stars 6 forks source link

Too many tcp connects to port 1400 #30

Closed grodi closed 4 years ago

grodi commented 4 years ago

Why does the plugin need to open a new tcp connection on port 1400 every second? if required, is it possible to reduce the interval? Thanks

Supergiovane commented 4 years ago

Hello grodi Monday i’ll give a shot and i’ll let you know what the hell it does. It should open only one port as input, the port you specify in the config node. PS: thank uou for using one of my nodes.

grodi commented 4 years ago

Hello Supergiovane, many thanks for this great plugin! It works very well! The only issue is that it permanently opens sessions, starting after the first usage. This happens even no new tts are triggered. On my raspi netstat shows, nodemin@raspi:~ $ netstat -atn | grep 1400 tcp 0 0 10.10.10.15:42396 10.10.10.241:1400 TIME_WAIT tcp 0 0 10.10.10.15:42640 10.10.10.241:1400 TIME_WAIT tcp 0 0 10.10.10.15:42368 10.10.10.241:1400 TIME_WAIT tcp 0 0 10.10.10.15:42276 10.10.10.241:1400 TIME_WAIT tcp 0 0 10.10.10.15:42728 10.10.10.241:1400 TIME_WAIT tcp 0 1 10.10.10.15:42812 10.10.10.241:1400 SYN_SENT tcp 0 0 10.10.10.15:42308 10.10.10.241:1400 TIME_WAIT tcp 0 0 10.10.10.15:42732 10.10.10.241:1400 TIME_WAIT tcp 0 1 10.10.10.15:42814 10.10.10.241:1400 SYN_SENT tcp 0 0 10.10.10.15:42800 10.10.10.241:1400 TIME_WAIT tcp 0 0 10.10.10.15:42730 10.10.10.241:1400 TIME_WAIT

Supergiovane commented 4 years ago

Hello Chris Sorry, today i’m sick and i’ve had no time to investigate. I suspect a polling to sonos, to intercept the playback state. If this is true, there is less to do. What is the 10.10.10.241?

Supergiovane commented 4 years ago

Hello Chris, yes i can confirm that this node.oTimer=setTimeout(function(){HandleQueue(node);},1000); does trigger the call to Sonos, querying the playback status. I discovered that a simple registration for Sonos event, doesn't work everytime, so i decided to switch to an active polling. This behaviour cannot yet be changed, but i'll watch for a change in the future. Hope this helps and again thank you for using one of my node! Really appreciate that.

grodi commented 4 years ago

Hello Supergiovane, ok, many thanks for your quick answer! Would be cool, if the behavior could be improved in the future... Thanks for your plugin! Chris