[Libwebsockets] EXT: Re: EXT: Re: disconnection after 310 secondes

Andy Green andy at warmcat.com
Wed Sep 30 10:11:15 CEST 2020



On 9/30/20 8:26 AM, Peiffer Eric wrote:
> OK, I got it,
> 
> But if the ping/pong mechanism is enable on web socket level, with a 
> period less than the validity time out,
> connection will never be closed by this validity timeout?

Yeah... eg, build lws-minimal-ws-server and run with -v to set 3s 
validity check interval and 5s hangup limit.

You will see in tcpdump, the server is provoking PINGs every 3s like it 
is supposed to

09:09:42.178032 IP localhost.7681 > localhost.49922: Flags [P.], seq 
1948110359:1948110361, ack 1265785348, win 512, options [nop,nop,TS val 
3275516379 ecr 3275513377], length 2
09:09:42.178306 IP localhost.49922 > localhost.7681: Flags [P.], seq 
1:7, ack 2, win 512, options [nop,nop,TS val 3275516379 ecr 3275516379], 
length 6
09:09:42.178376 IP localhost.7681 > localhost.49922: Flags [.], ack 7, 
win 512, options [nop,nop,TS val 3275516379 ecr 3275516379], length 0
09:09:45.179948 IP localhost.7681 > localhost.49922: Flags [P.], seq 
2:4, ack 7, win 512, options [nop,nop,TS val 3275519380 ecr 3275516379], 
length 2
09:09:45.180112 IP localhost.49922 > localhost.7681: Flags [P.], seq 
7:13, ack 4, win 512, options [nop,nop,TS val 3275519381 ecr 
3275519380], length 6
09:09:45.180147 IP localhost.7681 > localhost.49922: Flags [.], ack 13, 
win 512, options [nop,nop,TS val 3275519381 ecr 3275519381], length 0

-Andy


More information about the Libwebsockets mailing list