From c26763ac5d8bb360dcb404eddeb1d4307c556c13 Mon Sep 17 00:00:00 2001 From: uhi22 Date: Tue, 8 Aug 2023 00:42:45 +0200 Subject: [PATCH] fix: removed other unused gethostbyname and getaddrinfo to avoid crash in simulation mode --- pyPlcTcpSocket.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pyPlcTcpSocket.py b/pyPlcTcpSocket.py index c14da9a..e726adb 100644 --- a/pyPlcTcpSocket.py +++ b/pyPlcTcpSocket.py @@ -186,15 +186,7 @@ class pyPlcTcpServerSocket(): self.ourSocket.listen(1) self.callbackStateNotification(1) # inform the higher level state machines, that TCP is listening self.addToTrace("pyPlcTcpSocket listening on port " + str(self.tcpPort)) - hostname=socket.gethostname() - IPAddr=socket.gethostbyname(hostname) - addressInfo = socket.getaddrinfo(hostname, None, socket.AF_INET6) - #print("Your Computer Name is:"+hostname) - self.addToTrace("The socket is linked the following IP addresses:") - for i in range(0, len(addressInfo)): - #fe80::4c46:fea5:b6c9:25a9 - IPv6Addr = addressInfo[i][4][0] - self.addToTrace(IPv6Addr) + # (unused gethostbyname removed, see https://openinverter.org/forum/viewtopic.php?p=59970#p59970) self.read_list = [self.ourSocket] self.rxData = []