This repository was archived by the owner on Feb 25, 2025. It is now read-only.
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Do port detection in cdc_rsync_server and cdc_fuse_fs instead of running netstat/ss #68
Open
Description
Running netstat/ss via ssh to find available ports is slow and not very robust. It would be better to detect ports in C++ code. One problem right now is when cdc_rsync_server is started, the port must be known as port forwarding is set up at the same time.
Instead doing this:
- Run netstat locally and remotely to find available ports
- Run an ssh command that sets up port forwarding and executes cdc_rsync_server / cdc_fuse_fs
- Connect to port
Do this:
- Run an ssh command that executes cdc_rsync_server / cdc_fuse_fs
- In cdc_rsync_server / cdc_fuse_fs, detect available ports (in C++ code!), print out "...is listening on port X" and block
- In cdc_rsync / cdc_stream, read port, find available local port (in C++ code!), set up port forwarding and connect to port