OctopusDeploy / Halibut

| Public | A secure communication stack for .NET using JSON-RPC over SSL.
Other
12 stars 44 forks source link

Support keepalives on WebSockets #588

Open LukeButters opened 11 months ago

LukeButters commented 11 months ago

KeepAlives are a useful way of keeping open TCP connections and detecting if a TCP connection is broken, including in the case of a non graceful TCP termination. We have enabled TCP keepalives for listening and polling tentacles as described in https://github.com/OctopusDeploy/OctopusTentacle/issues/692 . Doing so allows Halibut to detect failed connections allowing the caller to retry sooner and in the case of polling tentacles allows for the Polling tentacle to establish a new working connection sooner.

Currently we don't support TCP keepalives for Polling WebSockets as dicussed in this PR, we found that keep alives were only working with TCP connections, not web sockets.

Ideally we should support TCP keepalives with websocket, in this way TCP connectoons that are not gracefully terminated can be detected earlier allowing for callers to be told earlier that the RPC has failed allowing them to retry sooner.