summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/TCPSocket.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-06-07 18:36:38 +0000
committerPavel Labath <labath@google.com>2016-06-07 18:36:38 +0000
commit5de59348fe0e1844b9df471f2313711830ebc869 (patch)
tree691ce3430b958102ed15d591b4ba9fafc25e618c /lldb/source/Host/common/TCPSocket.cpp
parenta1f9a2daebf623c2be291f0bbdd128d718bd7b44 (diff)
downloadbcm5719-llvm-5de59348fe0e1844b9df471f2313711830ebc869.tar.gz
bcm5719-llvm-5de59348fe0e1844b9df471f2313711830ebc869.zip
Don't use SO_REUSEADDR for *client* sockets
Summary: In the case of client sockets, we are not binding to a specific port, so we should be able to just request a new one. Disregarding refactors, this code has been here since the initial LLDB checkin, so I was unable to figure out whether it was added as a fix for a specific problem, or just for symmetry with server sockets, but I see no side-effect from removing it now. I was still able to create 10000 connections within a couple of seconds, so I think it's unlikely we will exhaust the port space (previously, I would get an error after a couple thousand connections). This fixes an occasional issue with connecting to the android debug bridge deamon on OSX when running the test suite, which would occasionaly fail with EADDRINUSE. My best guess is that this was happening because two processes were assigned the same client port number, and then things blew up because they were both trying to connect to the same ADB server port. I have not observed this issue happening on Linux or Windows. Reviewers: clayborg Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: http://reviews.llvm.org/D21088 llvm-svn: 272041
Diffstat (limited to 'lldb/source/Host/common/TCPSocket.cpp')
-rw-r--r--lldb/source/Host/common/TCPSocket.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/lldb/source/Host/common/TCPSocket.cpp b/lldb/source/Host/common/TCPSocket.cpp
index b23055ee7d8..07b0cdf908f 100644
--- a/lldb/source/Host/common/TCPSocket.cpp
+++ b/lldb/source/Host/common/TCPSocket.cpp
@@ -112,9 +112,6 @@ TCPSocket::Connect(llvm::StringRef name)
if (!DecodeHostAndPort (name, host_str, port_str, port, &error))
return error;
- // Enable local address reuse
- SetOptionReuseAddress();
-
struct sockaddr_in sa;
::memset (&sa, 0, sizeof (sa));
sa.sin_family = kDomain;
OpenPOWER on IntegriCloud