diff options
author | Guantao Liu <guantaol@users.noreply.github.com> | 2018-11-13 12:34:27 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-13 12:34:27 -0800 |
commit | 85d85bd0c373d08f3326422f91e2bf9d207081c3 (patch) | |
tree | 58c6bef5255ac43cd0e1d3c94ff5584159311e48 /src/core/lib | |
parent | fda941a60c1bf6b8c6d9abb238fc653e070b56fb (diff) | |
parent | 4f9bdf4e06465205dc13715b07b428a2cc4a87c2 (diff) |
Merge pull request #17193 from guantaol/client_reuse_addr
Enable SO_REUSEADDR in client sockets
Diffstat (limited to 'src/core/lib')
-rw-r--r-- | src/core/lib/iomgr/tcp_client_posix.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/tcp_client_posix.cc b/src/core/lib/iomgr/tcp_client_posix.cc index 8553ed0db4..0bff74e88b 100644 --- a/src/core/lib/iomgr/tcp_client_posix.cc +++ b/src/core/lib/iomgr/tcp_client_posix.cc @@ -76,6 +76,8 @@ static grpc_error* prepare_socket(const grpc_resolved_address* addr, int fd, if (!grpc_is_unix_socket(addr)) { err = grpc_set_socket_low_latency(fd, 1); if (err != GRPC_ERROR_NONE) goto error; + err = grpc_set_socket_reuse_addr(fd, 1); + if (err != GRPC_ERROR_NONE) goto error; err = grpc_set_socket_tcp_user_timeout(fd, channel_args, true /* is_client */); if (err != GRPC_ERROR_NONE) goto error; |