COVESA / vsomeip

An implementation of Scalable service-Oriented MiddlewarE over IP
Mozilla Public License 2.0
1.01k stars 647 forks source link

Use TCP keepalive to detect broken sockets #681

Open joeyoravec opened 3 weeks ago

joeyoravec commented 3 weeks ago

fixes COVESA/vsomeip#674

vsomeip does not enforce a single socket between endpoints; it does not actively close an existing socket after a new one is established.

It is possible that:

nodeB never received an RST while the cable was unplugged, still thinks the old socket is established, and effectively "leaks" until TCP keepalive detects the break. At default values this takes 2 hr 10 min. This can be mitigated by reducing the keepalive settings.

The implementation of TCP keepalive is different between OS:

QNX would need to set the global values using sysctl, perhaps at startup.

goncaloalmeida commented 2 weeks ago

@joeyoravec is this ready to review or are you still working on this?

joeyoravec commented 2 weeks ago

@joeyoravec is this ready to review or are you still working on this?

I've left this in draft so it's clear that this is not ready for merge. Yes this "works" and is worth reviewing.