From:  Andrew Sutherland <>
Date:  03 Feb 2015 22:15:37 Hong Kong Time

Advice about TCP Keep-Alive settings for raw TCP Socket API?


I raised an issue on the TCP and UDP socket web API spec ( about exposing TCP keep-alive settings at  I did this because for the Firefox OS Gaia email app we were seeing connections that were effectively dead but without reasonable TCP keepalive settings we weren't noticing this (and then were at the mercy of the TCP retransmit timeouts, presumably.)

Especially since we worked around the problem in the email app thus far by more aggressively closing otherwise-idle connections, I do not feel like I have sufficient wisdom/experience to confidently suggest the right course of defaults or whether it's best to expose the raw linux TCP stack settings or something else.

So, if those on this list have opinions, especially those backed up by data, it would be great if you could chime in on  It's probably worth noting that from the perspective of Firefox OS, the TCP socket API is a legacy API that exists to support existing pre-web technologies, but that web sockets and its origin-based security model are the way forward (or Web RTC's peer-to-peer mechanisms, etc.).  So the API doesn't have to be perfect.