Skip to content
Snippets Groups Projects
Commit 2a2b2ad2 authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

wip

parent 3e5fc2c3
No related branches found
No related tags found
No related merge requests found
......@@ -33,8 +33,14 @@ async def receive(websocket,path):
msg = await websocket.recv()
address = websocket.remote_address[0]
if (address != client):
#
# reject client
#
print("connection rejected from "+address)
continue
#
# accept client
#
print("connection accepted from "+address)
vars = json.loads(msg)
if (vars['type'] == 'open'):
......@@ -64,6 +70,9 @@ async def receive(websocket,path):
print(err)
await websocket.send(str(err))
elif (vars['type'] == 'command'):
#
# send command
#
print('send command')
data = vars['contents']
n = 0
......@@ -81,6 +90,9 @@ async def receive(websocket,path):
percent = (100.0*n)/len(data)
await websocket.send(str(percent))
elif (vars['type'] == 'file'):
#
# send file
#
print('send file')
data = vars['contents']
n = 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment