warmcat / libwebsockets

canonical libwebsockets.org networking library

Home Page:https://libwebsockets.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there any function can be used to monitor or handle package loss?

bethebest0622 opened this issue · comments

I used libwebsockets as a client to pass data with sever.

it worked very well, but sometimes it seems lose package.

the sitution is:

  1. lws_write to send_request to server, the return value is good, but no response (I codebug with server IT, it proved they didnt receive the request)
  2. server send data, i didn't receive it (I run the same code in two server, one received, one not, so i confirmed it's a package loss)

I know package loss is a network layer problem, maybe unavoidable in libwebsockets.

but is there any methods i can use to monitor it or reduce this siutation?

Thanks

This is maybe a bit confused... we're not using UDP which just sends a single packet, we're using TCP. It will resend packets after a short timeout. So it's fairly immune to loss of a single packet.

It sounds like something else is going on (tcpdump is useful to see what's really happening on the wire at each end, without trying to "prove" it).