Fix network echo test host scripts for Mac

It seems that the 0 aka 'any port' doesn't work well on Mac, causing
[Errno 49] Can't assign requested address errors.
pull/3436/head
Bartek Szatkowski 2016-12-13 13:17:44 +00:00
parent aa6780d54b
commit 859c160ddc
2 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ class TCPEchoClientTest(BaseHostTest):
:return:
"""
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect((target_ip, 0)) # Target IP, Any port
s.connect((target_ip, 8000)) # Target IP, 'random' port
ip = s.getsockname()[0]
s.close()
return ip

View File

@ -55,7 +55,7 @@ class UDPEchoClientTest(BaseHostTest):
:return:
"""
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect((target_ip, 0)) # Target IP, Any port
s.connect((target_ip, 8000)) # Target IP, 'random' port
ip = s.getsockname()[0]
s.close()
return ip