summaryrefslogtreecommitdiffstats
path: root/lldb/test/functionalities/connect_remote/EchoServer.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/functionalities/connect_remote/EchoServer.py')
-rwxr-xr-xlldb/test/functionalities/connect_remote/EchoServer.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/test/functionalities/connect_remote/EchoServer.py b/lldb/test/functionalities/connect_remote/EchoServer.py
index 3e6823c89d4..658690ec754 100755
--- a/lldb/test/functionalities/connect_remote/EchoServer.py
+++ b/lldb/test/functionalities/connect_remote/EchoServer.py
@@ -8,10 +8,11 @@ Taken from http://docs.python.org/library/socket.html#example.
import socket
HOST = 'localhost' # Symbolic name meaning local interfaces
-PORT = 12345 # Arbitrary non-privileged port
+PORT = 0 # Let the system give us a random free port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
-print '\nListening on %s:%d' % (HOST, PORT)
+PORT = s.getsockname()[1]
+print 'Listening on %s:%d' % (HOST, PORT)
s.listen(1)
conn, addr = s.accept()
print 'Connected by', addr
OpenPOWER on IntegriCloud