mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #3612 from bulislaw/fix_network_host_tool
tests: Fix error on MacOS for udp_dtls_handshake testpull/3649/head
commit
4e28b25399
|
@ -65,7 +65,10 @@ class UDPEchoClientTest(BaseHostTest):
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
s.connect((target_ip, 0)) # Target IP, Any port
|
try:
|
||||||
|
s.connect((target_ip, 0)) # Target IP, any port
|
||||||
|
except socket.error:
|
||||||
|
s.connect((target_ip, 8000)) # Target IP, 'random' port
|
||||||
ip = s.getsockname()[0]
|
ip = s.getsockname()[0]
|
||||||
s.close()
|
s.close()
|
||||||
return ip
|
return ip
|
||||||
|
|
Loading…
Reference in New Issue