Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeepAlive causing send after finish? #6

Open
dimitricole opened this issue Dec 28, 2023 · 0 comments
Open

KeepAlive causing send after finish? #6

dimitricole opened this issue Dec 28, 2023 · 0 comments

Comments

@dimitricole
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant