golongpoll icon indicating copy to clipboard operation
golongpoll copied to clipboard

Acks every 15 seconds

Open dimalukas opened this issue 3 years ago • 1 comments

Hi, While I was monitoring network traffic on my device I saw that every 15 seconds there are acks being sent between the longpoll client and server. Is this the intentional behavior? The activity does not need to be ‘silent’ until a timeout occurs or a disconnect or a publish? @jcuga D7BF0ED5-EA28-4574-9534-F433102B58DF

dimalukas avatar Jul 14 '22 07:07 dimalukas

@dimalukas this sounds like tcp keepalive.

See: https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html

This occurs at the TCP/transport level, before the HTTP/application level. So there will be no http data being sent, but you will see at the lower TCP level some zero-data ACKs that are part of the tcp-keepalive. The keep alive time is configurable usually at the OS level, not at a per-socket or per-application level.

Without keep-alives, there'd be no way for each side of the connection to know when a connection gets dropped.

This occurs at a lower, more fundamental level than HTTP and golongpoll specifically. I'd recommend looking at the traffic in wireshark or similar tool to verify that this is indeed zero-data keepalive traffic if you are concerned.

To your question about being "silent" until there is data (or a longpoll-timeout)--at the HTTP/application level, yes, there should be no data/communication.

jcuga avatar Jul 29 '22 18:07 jcuga