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:
@@ -57,9 +57,10 @@ struct SessionConfig {
|
||||
// Time to wait until running a manifest update after detecting a file change.
|
||||
uint32_t file_change_wait_duration_ms = 0;
|
||||
|
||||
// Ports used for local port forwarding.
|
||||
uint16_t forward_port_first = 0;
|
||||
uint16_t forward_port_last = 0;
|
||||
// Ports used for local port forwarding. Deprecated as forward ports are
|
||||
// determined automatically now using ephemeral ports.
|
||||
uint16_t deprecated_forward_port_first = 0;
|
||||
uint16_t deprecated_forward_port_last = 0;
|
||||
};
|
||||
|
||||
} // namespace cdc_ft
|
||||
|
||||
Reference in New Issue
Block a user