[Libwebsockets] Acknowledgement on lws_write / LWS_WRITE_BINARY?

Duane Butler Duane.Butler at calix.com
Sat Sep 12 19:15:45 CEST 2020


Andy, another quick question. Is it generally true that the transport is reliable? I’ve always assumed so since it is based on a TCP connection. 

Thanks.  

Duane. 

Sent from my iPhone

> On Sep 12, 2020, at 11:35 AM, Duane Butler <Duane.Butler at calix.com> wrote:
> 
> Thanks Andy, that’s kind of what I thought, but wanted to check.
> 
> Sent from my iPhone
> 
>> On Sep 12, 2020, at 10:53 AM, Andy Green <andy at warmcat.com> wrote:
>> 
>> [External Email]
>> 
>>> On 9/12/20 4:48 PM, Duane Butler wrote:
>>> Hello,
>>> 
>>> We’re using libwebsockets 4.0 stable.
>>> 
>>> We are seeing cases where client LWS_WRITE_BINARY messages are not being
>>> delivered due to unstable network connections and websocket closures in
>>> the middle of pending writes.
>>> 
>>> Is there a way for a client application to know if a message was
>>> actually delivered to the other side or not?
>> 
>> ws itself doesn't offer the concept of "transactions" in the same way
>> as, eg, http does, with a "request" and then a "response" with an
>> explicit code saying the disposition of the request.
>> 
>> If you want that, you have to add it into your ws subprotocol, eg, every
>> outgoing ws message with your subprotocol has an incrementing ordinal or
>> random token, and the peer will report back with an explicit disposition
>> message listing which ones it saw and what the disposition was.
>> 
>> -Andy


More information about the Libwebsockets mailing list