mirror of
https://github.com/google/cdc-file-transfer.git
synced 2026-09-13 01:10:44 +03:00
[common] Add support for ClientSocket on Linux (#97)
Uses the abstractions written for ServerSocket in ClientSocket, so that it builds on Linux. Also adds a method to poll for connections and uses that in cdc_rsync. Similar code will be used in cdc_fuse_fs to wait for a connection in a future CL.
This commit is contained in:
@@ -29,6 +29,10 @@ class ClientSocket : public Socket {
|
||||
ClientSocket();
|
||||
~ClientSocket();
|
||||
|
||||
// Polls until a connection to |port| succeeds.
|
||||
// Returns TimeoutError
|
||||
static absl::Status WaitForConnection(int port, absl::Duration timeout);
|
||||
|
||||
// Connects to localhost on |port|.
|
||||
absl::Status Connect(int port);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user