-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Hi - I am trying to use this code in my project but if I connect a socket, disconnect the socket, and wait a few seconds, keepAlive throws an error:
/Users/xxxxxx/src/xxxxxx/server/node_modules/websocket/lib/W3CWebSocket.js:111
throw new Error('cannot call send() while not connected');
^
Error: cannot call send() while not connected
at W3CWebSocket.send (/Users/xxxxxx/src/xxxxxx/server/node_modules/websocket/lib/W3CWebSocket.js:111:15)
at LiveClient.keepAlive (/Users/xxxxxx/src/xxxxxx/server/node_modules/@deepgram/sdk/dist/main/packages/LiveClient.js:55:22)
at Timeout._onTimeout (/Users/xxxxxx/src/xxxxxx/server/server.js:34:14)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
Any patterns documented for keepAlive in node? I'm confused why in this code example, keepAlive is globally scoped since it is being created / overwritten per socket?
Sidenote - also curious if best practice is to have one Deepgram client per socket, or share the same client?