summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/lib/oeqa/utils/network.py
diff options
context:
space:
mode:
authortakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
committertakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
commit1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch)
treecd70a267a5ef105ba32f200aa088e281fbd85747 /external/poky/meta/lib/oeqa/utils/network.py
parent4204309872da5cb401cbb2729d9e2d4869a87f42 (diff)
recipes
Diffstat (limited to 'external/poky/meta/lib/oeqa/utils/network.py')
-rw-r--r--external/poky/meta/lib/oeqa/utils/network.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/external/poky/meta/lib/oeqa/utils/network.py b/external/poky/meta/lib/oeqa/utils/network.py
index 2768f6c5..59d01723 100644
--- a/external/poky/meta/lib/oeqa/utils/network.py
+++ b/external/poky/meta/lib/oeqa/utils/network.py
@@ -1,7 +1,11 @@
+#
+# SPDX-License-Identifier: MIT
+#
+
import socket
-def get_free_port():
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+def get_free_port(udp = False):
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM if not udp else socket.SOCK_DGRAM)
s.bind(('', 0))
addr = s.getsockname()
s.close()