summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/network.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/utils/network.py')
-rw-r--r--meta/lib/oeqa/utils/network.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/network.py b/meta/lib/oeqa/utils/network.py
index 2768f6c5db..59d01723a1 100644
--- a/meta/lib/oeqa/utils/network.py
+++ b/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()