amazon-nova-samples icon indicating copy to clipboard operation
amazon-nova-samples copied to clipboard

(S2S sample-codes/websocket-nodejs) Active connections always 0

Open massi-ang opened this issue 10 months ago • 0 comments

server.ts shows always 0 as active connections.

This is due to using the wrong way of calculating connections count

https://github.com/aws-samples/amazon-nova-samples/blob/6f5ab3f04ea3b77ad7c5a228cc5a1dafe662be86/speech-to-speech/sample-codes/websocket-nodejs/src/server.ts#L65-L68

It should be:

io.sockets.sockets.size

The setInterval should be moved outside of the callback, otherwise every new connection will create a new one.

massi-ang avatar Apr 09 '25 13:04 massi-ang