sdroege/async-tungstenite

Please consider linking to ws_stream_tungstenite in the README

joshtriplett opened this issue · 7 comments

I'd love to have a link to the ws_stream_tungstenite crate in the README, as a suggestion for how to treat a WebSocket as a continuous stream of binary data rather than as discrete messages. That crate was hard to find, and a cross-reference would really help.

Does that crate implement any kind of standard or is it a custom stream protocol on top of websockets?

@sdroege Neither; it just treats the stream of binary messages as a continuous stream of bytes, ignoring message boundaries entirely. Using it on one end does not require using it on the other end.

Well, it removes the packetization from the websockets so depending on how it's used it could cause problems to use it.

Can you send a PR to add a note about it to the README.md, shortly describing in a sentence or two what it actually does?

Sure.

Also, I don't see how ignoring the packet boundaries would cause a problem, as long as the protocol in use doesn't place semantic significance on the packet boundaries.

Yes, that would be exactly when it causes problems :) Both sides need to agree that the packet boundary has no meaning and if needed implement a packetization protocol themselves on top of the stream of bytes.

Ah, sure. Yes, I was specifically thinking of the case where the packet boundaries don't actually matter; if the receiving end uses ws_stream_tungstenite and the sending end expects packet boundaries to matter, that's a programming error on the receiving end for throwing away that information.