From 4fdd8371105b687c7023652f5eb52fd21976042b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sun, 27 Mar 2022 13:06:05 +0200 Subject: [PATCH] changed something --- main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index caabe8d..2b1df0d 100644 --- a/main.py +++ b/main.py @@ -99,9 +99,7 @@ def socket_listener(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((SOCKET_BIND_IP, SOCKET_BIND_PORT)) s.listen() - global conn - global addr - conn, addr = s.accept() + return s.accept() if __name__ == '__main__': strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL) @@ -116,6 +114,7 @@ if __name__ == '__main__': try: while True: + conn, addr = socket_listener() socket_data = conn.recv(1024) print(socket_data) print(type(socket_data))