[Libwebsockets] how is partial write handled

LANGLOIS Olivier PIS -EXT olivier.pis.langlois at transport.alstom.com
Fri Oct 18 00:59:11 CEST 2013


I think that I understand a little bit better what happens.

Remember when I said the way you describe SO_SNDBUF sounded more like SO_SNDLOWAT?

I did remember that the library also disable Nagle with TCP_NODELAY. In a LAN, what this combination will do is make a TCP connection approximate a UDP socket in a LAN because RTT is very low. On the Internet with RTT > 200 ms and with an intensive bandwidth app (ie: video streaming on websockets: http://phoboslab.org/log/2013/09/html5-live-video-streaming-via-websockets ), we will get partial writes even with appropriate SO_SNDBUF and TCP_NODELAY on.

> >Can I use your library if I cannot predict ahead of time the length of
> >my messages because their length is variable?
> Yes... websockets itself defines fragments for that purpose.
I have read the readme file describing fragments. My understanding was that this was supported for the receiving side.
Does the library support fragments on the sending side as well?

CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.

More information about the Libwebsockets mailing list