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

websocket send() can't write messages > kTxBufferSize (1024 bytes) #313

Closed
dckc opened this issue Jan 16, 2020 · 1 comment · May be fixed by #324
Closed

websocket send() can't write messages > kTxBufferSize (1024 bytes) #313

dckc opened this issue Jan 16, 2020 · 1 comment · May be fixed by #324

Comments

@dckc
Copy link
Contributor

dckc commented Jan 16, 2020

websocket.js passes up to 64k of data to one call to socket.send(), but kTxBufferSize is only 1024 bytes, so I get:

modules/network/socket/lin/modSocket.c (761) # Exception: (host): can't write all data!

The docs say to use socket.send() with no args to get the amount of data that can be sent.

I guess I can bump up kTxBufferSize but websocket.js should break the data into pieces, no?

@phoddie
Copy link
Collaborator

phoddie commented Mar 7, 2022

Having a limit on the output is by design as it models the reality of limited TCP buffer space on microcontrollers. The WebSockets implementation could buffer, only helps a handful of cases as it still uses additional RAM. A scalable solution would involve a streaming data callback so that the data can be synthesized or loaded into RAM in parts, as write buffer space becomes available. That's a significant undertaking, perhaps more appropriate for the TC53 network protocols effort.

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

Successfully merging a pull request may close this issue.

2 participants