ockam
ockam copied to clipboard
added Tcp keepalive & removed Tcp heartbeat
Current Behavior
Current implementations of TCP clients need to rely on ad-hoc heartbeats in order to keep the TCP connection open.
Proposed Changes
Enable tcp_keepalive for the TcpStream
through the socket2
crate and remove usage of custom heartbeat.
This addresses: https://github.com/build-trust/ockam/issues/3450 and possibly https://github.com/build-trust/ockam/issues/3480
Checks
- [ ] All commits in this Pull Request are signed and Verified by Github.
- [ ] All commits in this Pull Request follow the Ockam commit message convention.
- [x] I accept the Ockam Community Code of Conduct.
- [ ] I have accepted the Ockam Contributor License Agreement by adding my Git/Github details in a row at the end of the CONTRIBUTORS.csv file in a separate pull request to the build-trust/ockam-contributors repository.
The current changes "should" enable tcp keepalive for the TcpStream
. Maybe it makes sense to add a test for this? On the other hand the only change is turning on tcp keepalive, so maybe that should already be tested by the socket2
crate.
Also I wasn't sure if the place where I instantiated the socket2::TcpKeepalive
is the best one or if that should happen in the calling function async fn process
in listener.rs
or some other place.
I forgot to add my new key to git before the commit so the first commit is not verified. I'm not sure if I can fix this now. I can also add my name to the CONTRIBUTORS.csv file if this PR is merged.
Since today is the last day of hacktoberfest
, I've add the hacktoberfest-accepted
label in case you're participating. We can merge the PR after the current on going discussion is resolved.
Hey @phillyphil91 , very nice job! Could you please resolve my latest comments and do a rebase? Also, could you please update Cargo.lock
and squash your changes into 1 commit that follows the Ockam commit message convention? That is required to pass CI checks
@phillyphil91 could you please sign the Ockam Contributor License Agreement by adding my Git/Github details in a row at the end of the CONTRIBUTORS.csv file in a separate pull request to the build-trust/ockam-contributors repository.
@SanjoDeundiak done
@phillyphil91 congratulations on an amazing first contribution 🥳🥳🥳🥳
@mrinalwadhwa thanks. great experience. hopefully more to come