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
1 changed files with 173 additions and 171 deletions
4
sock.py
4
sock.py
|
@ -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" : "..."
|
||||
|
|
Loading…
Reference in a new issue