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

Add support for fragmentation #57

Open
NimaAra opened this issue Aug 23, 2016 · 2 comments
Open

Add support for fragmentation #57

NimaAra opened this issue Aug 23, 2016 · 2 comments

Comments

@NimaAra
Copy link

NimaAra commented Aug 23, 2016

First of all, your library is great! so thank you for making it available.

It will be very useful if WebSocket4Net could support fragmentation.

As far as I am aware, both Microsoft's ClientWebSocket and WebSocketSharp support fragmentation but based on my last test WebSocket4Net does not.

Thank you,
Nima

@kerryjiang
Copy link
Owner

Hello Nima, do you mean you want WebSocket4Net expose an api to send fragments by yourself?

@NimaAra
Copy link
Author

NimaAra commented Aug 24, 2016

Hello,

Not really. I am referring to the section 5.4 of the RFC-6455.

The primary purpose of fragmentation is to allow sending a message that is of unknown size when the message is started without having to buffer that message. If messages couldn't be fragmented, then an endpoint would have to buffer the entire message so its length could be counted before the first byte is sent. With fragmentation, a server or intermediary may choose a reasonable size buffer and, when the buffer is full, write a fragment to the network.

A secondary use-case for fragmentation is for multiplexing, where it is not desirable for a large message on one logical channel to monopolize the output channel, so the multiplexing needs to be free.

This issue relates to the client not being able to receive fragmented messages sent by the server.

If you look at the example I provided above you will see the effect of this on a client using WebSocket4Net to connect to a server sending fragmented messages. It essentially never receives such messages.

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

No branches or pull requests

2 participants