Using TCP keepalive with Go
felixge.de
Using TCP keepalive with Go
1–5 of 5 posts
Re: Using TCP keepalive with Go
#2Re: Using TCP keepalive with Go
#3Article points it out but to put a little emphasis on it. Its a good idea to implement a software level keep alive instead of relying on the TCP level one. Some ISPs drop keepalives, especially cellular carriers (support is optional and not guaranteed per rfc). Keeping a persistent connection over some of these networks are tricky and require different minimum timeouts... and some charge by amount of data so you want…
Re: Using TCP keepalive with Go
#4What will happen to your connection if the network cable is plugged back in? Guess what, TCP will most likely recover and behave as if nothing happened. Keep in mind that opening a new connection is probably pretty expensive, especially if TLS is involved. So keep calm and let TCP do its magic.
Re: Using TCP keepalive with Go
#5Edit: I'm saying this to clarify that I'm not recommending TCP keepalive for most scenarios.