From 3ba61a10bd32c2514a9c7fb0162fc6133c97a709 Mon Sep 17 00:00:00 2001 From: Ryan Melton Date: Sat, 22 Feb 2025 10:50:14 -0700 Subject: [PATCH] Add exception catch on python hostname lookup --- openc3/python/openc3/interfaces/tcpip_server_interface.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openc3/python/openc3/interfaces/tcpip_server_interface.py b/openc3/python/openc3/interfaces/tcpip_server_interface.py index 666205429..d0474495d 100644 --- a/openc3/python/openc3/interfaces/tcpip_server_interface.py +++ b/openc3/python/openc3/interfaces/tcpip_server_interface.py @@ -374,7 +374,11 @@ def _listen_thread_body(self, listen_socket, listen_write, listen_read, thread_r if self.cancel_threads: break host_ip, port = address - hostname, _, _ = socket.gethostbyaddr(host_ip) + try: + hostname, _, _ = socket.gethostbyaddr(host_ip) + except Exception: + hostname = "UNKNOWN" + # Configure TCP_NODELAY option client_socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)