[Libwebsockets] Problem sending more than 3263 bytes on ws

pierre30 at gmail.com pierre30 at gmail.com
Wed Jun 27 17:36:49 CEST 2018


Hello,

I have a problem when sending more than 3263 bytes on websocket using 
lws_write() function. The problem appears with firefox and libwebsocket 
version 3.0.I had no problem with version 2.0 whatever the browser I 
used. It’s still good with Edge and version 3.0.

When I try to send 3264 bytes, I receive 3421 bytes (+ 157 bytes) in the 
Javascript on Firefox. Idem when I try to send more bytes, the 
Javascript receive extra bytes in multiples of 157. If I try to send 
41990 bytes, I receive 42304 bytes (+ 2*157 bytes).


On the libwebsocket side here are the following notice messages (no 
notice when connected with Edge):
[2018/06/27 16:26:41,519] Send WS: size = 3264
[2018/06/27 16:26:41,519] NOTICE: write drain len 1019 (wp 0x1) SETTING 
tx_draining_ext
[2018/06/27 16:26:41,519] lws_write() return: 3264
[2018/06/27 16:26:41,549] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:26:41,549] NOTICE: FORCED draining wp to 0x02 (stashed 
0x01, incoming 0x01)


[2018/06/27 16:24:42,460] Send WS: size = 41990
[2018/06/27 16:24:42,465] NOTICE: write drain len 1019 (wp 0x1) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,465] lwswrite() return: 41990
[2018/06/27 16:24:42,498] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,498] NOTICE: FORCED draining wp to 0x02 (stashed 
0x01, incoming 0x01)
[2018/06/27 16:24:42,498] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,545] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,545] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)
[2018/06/27 16:24:42,545] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,596] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,596] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)
[2018/06/27 16:24:42,596] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,644] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,644] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)
[2018/06/27 16:24:42,644] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,691] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,691] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)
[2018/06/27 16:24:42,691] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,740] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,740] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)
[2018/06/27 16:24:42,740] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,790] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,790] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)
[2018/06/27 16:24:42,790] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,838] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,838] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)
[2018/06/27 16:24:42,838] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,888] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,888] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)
[2018/06/27 16:24:42,888] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,935] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,936] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)
[2018/06/27 16:24:42,936] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:42,984] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:42,984] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)
[2018/06/27 16:24:42,984] NOTICE: write drain len 1024 (wp 0x2) SETTING 
tx_draining_ext
[2018/06/27 16:24:43,033] NOTICE: rops_write_role_protocol_ws: CLEARING 
tx_draining_ext
[2018/06/27 16:24:43,033] NOTICE: FORCED draining wp to 0x02 (stashed 
0x02, incoming 0x01)

I don’t understand what the notice means and what I can do in 
libwebsocket to have something working on Firefox?

Thanks,
Pierre.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20180627/59305910/attachment-0001.html>


More information about the Libwebsockets mailing list