[Libwebsockets] Libwebsocket identifying PING packet

techi eth techieth at gmail.com
Wed Oct 19 11:07:15 CEST 2016


Hi,

Sorry for not updating on SSL issue.I am still analyzing issue by using
wireshark.
Only problem is i am not able to reproduce the same issue.I have seen the
same once with my test application.

Regarding PING/Pong interval I understand setting interval to defined value
will result in my test client/server will do ping on connection & expect
pong within defined interval.

On other side if i have set this as zero & if other client/server will send
PING than in this case lws will automatically reply Pong Or it expect
application to do the same ?

Thanks

On Wed, Oct 19, 2016 at 1:35 PM, Andy Green <andy at warmcat.com> wrote:

> On Wed, 2016-10-19 at 13:17 +0530, techi eth wrote:
> > Hi,
>
> Can you let us know what happened about your last problem, "SSL Error"?
>  Posting on a mailing list you're inviting a lot of people to read
> about your problem.  It'd be nice to fill them in with what happened in
> case they ever meet something similar.
>
> > I am running server & one of connected client trying to send ping
> > packet.I need to identify that packet & response pong.
> >
> > How to identify ping packet on web socket callback ?
> >
> > I understand we can write PONG by using LWS_WRITE_PONG in response of
> > Ping.
>
> Lws automatically sends a PONG when it receives a PING.  It's not
> passed through to the user code.
>
> What goes in the PONG is mandated to be exactly the the PING payload
> returned and nothing else.
>
> If you are looking for dead connection detection, in 2.1 and later
> there is this in the context creation info that provides it
> automatically
>
>         unsigned short ws_ping_pong_interval;
>         /**< CONTEXT: 0 for none, else interval in seconds between
> sending
>          * PINGs on idle websocket connections.  When the PING is sent,
>          * the PONG must come within the normal timeout_secs timeout
> period
>          * or the connection will be dropped.
>          * Any RX or TX traffic on the connection restarts the interval
> timer,
>          * so a connection which always sends or receives something at
> intervals
>          * less than the interval given here will never send PINGs /
> expect
>          * PONGs.  Conversely as soon as the ws connection is
> established, an
>          * idle connection will do the PING / PONG roundtrip as soon as
>          * ws_ping_pong_interval seconds has passed without traffic
>          */
>
> -Andy
>
>
> >
> > _______________________________________________
> > Libwebsockets mailing list
> > Libwebsockets at ml.libwebsockets.org
> > http://libwebsockets.org/mailman/listinfo/libwebsockets
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20161019/a353e2e8/attachment-0001.html>


More information about the Libwebsockets mailing list