Extend connect API to handle Viewer's later start or reconnect
Currently, the workflow of the logger-viewer implies that the viewer is running before logging starts, otherwise, it will lead to data accumulation (see #6933 ) and never connect. In practice, it is important to have the ability to know whether connect to the viewer was successful or not and monitor connectivity status somehow.
Describe the solution you'd like
- Extend C++ API to indicate whether connect is successful or not - this would allow users to implement logic which attempts to connect.
- Extend C++ API to indicate that the Viewer has been disconnected - this would allow users to handle such cases and initiate reconnect.
New API interfaces would allow users to handle these cases:
- Viewer starts after logger: Logger could make periodical checks/attempts to connect and once it is connected, it will start logging.
- Connected Viewer is closed or restarted: Logger should somehow monitor connection status and switch to periodical checks if the Viewer was disconnected.
I don't think this applies to the C++ sdk in particular and is rather an issue in all APIs
This feature would be very useful. Currently the SDK does not even provide connection status that clients can use to handle this on their end.
Hi, is this issue still active? Thanks.
There is a server mode in rerun sdk. In such mode, we can later open a rerun viewer like, rerun --connect rerun+http://127.0.0.1:9876/proxy to connect to a exist rerun server. Note please, 127.0.0.1 should be your correct ip address rerun server running on.
This feature meets my need. Codes as following:
// Parse address to extract host and port
std::string host = "0.0.0.0";
uint16_t port = 9876;
auto result = rec_->serve_grpc(host, port);
Edit: Be careful, it looks like the memory usage of the Rerun server keeps increasing until it eventually OOMs.