From 7f13c3f5cf71214b8365139553a2c8866ace461a Mon Sep 17 00:00:00 2001 From: uhi22 Date: Mon, 7 Aug 2023 04:18:31 +0200 Subject: [PATCH] fix: remove unnecessary getaddrinfo and gethostbyname --- pyPlcTcpSocket.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/pyPlcTcpSocket.py b/pyPlcTcpSocket.py index 473db5a..c14da9a 100644 --- a/pyPlcTcpSocket.py +++ b/pyPlcTcpSocket.py @@ -168,15 +168,7 @@ class pyPlcTcpServerSocket(): 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() - self.addToTrace(hostname) - 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) + self.addToTrace("Hostname is " + hostname) self.read_list = [self.ourSocket] self.rxData = []