vsomeip
vsomeip copied to clipboard
Modify network detection on QNX to delay SD
Overview
Introducing a simple_connector to mimic the netlink_connector (in a very limited way) on QNX. This PR is not intended to be merged upstream, but instead serves as a discussion topic and example.
Description
Implemented a "simple_connector" to mimic the netlink_connector available on Linux. This connector, along with vsomeip3.5.4 introduction of the RS_DELAYED_RESUME routing state, allows us to delay SD until the network is available.
The simple_connector works by using QNX's waitfor to wait for a file whose creation indicates network availability. This file is created externally.
The simple_connector does not continue to monitor the network. It simply notifies the routing_manager the first time the network is available.
That said, the interface does allow for easy extension in the future
This behaviour is controlled with the env vars
VSOMEIP_USE_ASYNCHRONOUS_SD and VSOMEIP_WAIT_FOR_INTERFACE.
An alternative implementation would be to use PPS, but that isn't available by default on our deployment of QNX 7.
This implementation has a reduced foot print from earlier implementations and also does not modify any interfaces.
Notes
- There is no timeout on the
waitfor. The original implementation had a configurable timeout, however because timing out left us in an error state anyways, this timeout was removed (raised tonumeric_limits<int>::max()= ~45 days, give or take.) - This capability was previously implemented in https://github.com/COVESA/vsomeip/pull/710 for 3.4.10, however that change had a huge footprint and fundamentally altered the startup process making it hard to maintain