[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:
Lutz Justen
2023-05-27 21:18:13 +02:00
committed by GitHub
parent 26ff93489e
commit 678ee0ffaf
6 changed files with 185 additions and 143 deletions

View File

@@ -62,7 +62,10 @@ cc_library(
cc_library(
name = "client_socket",
srcs = ["client_socket.cc"],
srcs = [
"client_socket.cc",
"socket_internal.h",
],
hdrs = ["client_socket.h"],
linkopts = select({
"//tools:windows": [
@@ -70,7 +73,6 @@ cc_library(
],
"//conditions:default": [],
}),
target_compatible_with = ["@platforms//os:windows"],
deps = [
":log",
":socket",
@@ -473,7 +475,10 @@ cc_test(
cc_library(
name = "server_socket",
srcs = ["server_socket.cc"],
srcs = [
"server_socket.cc",
"socket_internal.h",
],
hdrs = ["server_socket.h"],
linkopts = select({
"//tools:windows": [