mirror of
https://github.com/google/cdc-file-transfer.git
synced 2026-09-13 01:10:44 +03:00
[cdc_stream] Use ephemeral ports (#100)
Instead of running netstat/ss on local and remote systems, just bind with port 0 to find an ephemeral port. This is much more robust, simpler and a bit faster. Since the remote port is only known after running cdc_fuse_fs, port forwarding has to be set up after running cdc_fuse_fs.
This commit is contained in:
@@ -58,9 +58,7 @@ class Session {
|
||||
|
||||
// Starts the CDC FUSE on the instance with established port forwarding.
|
||||
// |local_port| is the local reverse forwarding port to use.
|
||||
// [|first_remote_port|, |last_remote_port|] are the allowed remote ports.
|
||||
absl::Status Start(int local_port, int first_remote_port,
|
||||
int last_remote_port);
|
||||
absl::Status Start(int local_port);
|
||||
|
||||
// Shuts down the connection to the instance.
|
||||
absl::Status Stop() ABSL_LOCKS_EXCLUDED(transferred_data_mu_);
|
||||
|
||||
Reference in New Issue
Block a user