mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
socket connection keep alive
This commit is contained in:
parent
0c7795e2e6
commit
32b0fa9534
4
sock.py
4
sock.py
|
@ -21,7 +21,8 @@ import helpers
|
||||||
class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
||||||
|
|
||||||
def handle(self):
|
def handle(self):
|
||||||
|
while 1:
|
||||||
|
time.sleep(0.01)
|
||||||
encoding = 'utf-8'
|
encoding = 'utf-8'
|
||||||
#data = str(self.request.recv(1024), 'utf-8')
|
#data = str(self.request.recv(1024), 'utf-8')
|
||||||
|
|
||||||
|
@ -36,6 +37,7 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
||||||
|
|
||||||
# convert data to json object
|
# convert data to json object
|
||||||
received_json = json.loads(data)
|
received_json = json.loads(data)
|
||||||
|
print(received_json)
|
||||||
|
|
||||||
# GET COMMANDS
|
# GET COMMANDS
|
||||||
# "command" : "..."
|
# "command" : "..."
|
||||||
|
|
Loading…
Reference in a new issue