socket connection keep alive

This commit is contained in:
DJ2LS 2021-05-28 20:54:23 +02:00 committed by GitHub
parent 0c7795e2e6
commit 32b0fa9534
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,8 @@ import helpers
class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
while 1:
time.sleep(0.01)
encoding = 'utf-8'
#data = str(self.request.recv(1024), 'utf-8')
@ -36,6 +37,7 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
# convert data to json object
received_json = json.loads(data)
print(received_json)
# GET COMMANDS
# "command" : "..."