Added socket threading

master
Ebbe Baß 2022-03-27 13:04:57 +02:00
parent 36ddcad9c5
commit 167ef97546
1 changed files with 4 additions and 4 deletions

View File

@ -98,7 +98,7 @@ def power_toggle(channel):
def socket_listener():
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((SOCKET_BIND_IP, SOCKET_BIND_PORT))
s.listen(1)
s.listen()
global conn
global addr
conn, addr = s.accept()
@ -116,9 +116,9 @@ if __name__ == '__main__':
try:
while True:
# socket_data = conn.recv(1024)
# print(socket_data)
# print(type(socket_data))
socket_data = conn.recv(1024)
print(socket_data)
print(type(socket_data))
if led_power == True:
if check_internet() == False:
blink(strip, Color(255,0,0), Color(255,255,255))