snapview / tokio-tungstenite

Future-based Tungstenite for Tokio. Lightweight stream-based WebSocket implementation
MIT License
1.88k stars 236 forks source link

Error "No buffer space available" while sending a Binary Message #261

Closed lauti7 closed 1 year ago

lauti7 commented 1 year ago

Hi! I've been using tokio-tungstenite for this project https://github.com/decentraland/rpc-rust and I'm running stress tests for the project. And now I found an issue after sending several binary messages through the WebSocket. The binary message has a (binary encoded) text with a size of ~1.20MB (for the stress tests) and after several messages are sent, the WriteStream::send suddenly fails with this error:

Io(Os { code: 55, kind: Uncategorized, message: "No buffer space available" })

Is there any workaround for this? Any config to avoid this error?

Thank you in advance!

daniel-abramov commented 1 year ago

Hey, this error does not originate from tungstenite. As you can see, the type of the error is Os, this means that we're just forwarding the error that we've received from the operating system. The same error would happen if you used regular TCP sockets for the communication while attempting to write to the socket. I'm closing this one since it seems to be a duplicate of https://github.com/snapview/tungstenite-rs/issues/336