79548062

Date: 2025-04-01 08:23:26
Score: 0.5
Natty:
Report link

ok, that works great, in 100% of all cases so far

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as tcp:
            try:
                tcp.settimeout(self.timeout)
                tcp.connect((self.ip, self.port))
                tcp.settimeout(None)
                i = 0
                data = []
                while len(data) != 7 or i > 10:
                    tcp.sendall(b"\x61\x03\x00\x20\x00\x01\x8c\x60")
                    time.sleep(0.05)
                    data = tcp.recv(self.bytes)
                    i += 1
                tcp.close()

50ms waiting time has solved the problem. The 10-fold white loop is only for additional security

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Microscoop