mirror of
https://github.com/google/cdc-file-transfer.git
synced 2026-09-13 01:10:44 +03:00
[cdc_rsync] Use any available server port (#94)
Instead of calling netstat on the remote device to detect available ports, simply call bind with port 0 to bind to any available port. Since the port is not yet known when cdc_rsync_server.exe is called, port forwarding needs to be started AFTER the server reports its port.
This commit is contained in:
@@ -43,9 +43,10 @@ class CdcRsyncServer {
|
||||
// up-to-date by checking their sizes and timestamps.
|
||||
bool CheckComponents(const std::vector<GameletComponent>& components);
|
||||
|
||||
// Listens to |port|, accepts a connection from the client and runs the rsync
|
||||
// procedure.
|
||||
absl::Status Run(int port);
|
||||
// Listens to any available port, accepts a connection from the client and
|
||||
// runs the rsync procedure. Prints "Port <n>: Server is listening" to stdout,
|
||||
// so the client can retrieve the selected port.
|
||||
absl::Status Run();
|
||||
|
||||
// Returns the verbosity sent from the client. 0 by default.
|
||||
int GetVerbosity() const { return verbosity_; }
|
||||
|
||||
Reference in New Issue
Block a user