mirror of
https://github.com/titanscouting/tra-superscript.git
synced 2024-12-30 19:39:09 +00:00
parent
91f34a8d74
commit
962061007b
@ -1,20 +0,0 @@
|
|||||||
import asyncio
|
|
||||||
import datetime
|
|
||||||
import random
|
|
||||||
import websockets
|
|
||||||
|
|
||||||
async def time(websocket, path):
|
|
||||||
print(path)
|
|
||||||
i = 0
|
|
||||||
while True:
|
|
||||||
#now = datetime.datetime.utcnow().isoformat() + "Z"
|
|
||||||
#await websocket.send(now)
|
|
||||||
#await asyncio.sleep(random.random() * 3)
|
|
||||||
i += 1
|
|
||||||
await websocket.send(str(i))
|
|
||||||
await asyncio.sleep(1)
|
|
||||||
|
|
||||||
start_server = websockets.serve(time, "127.0.0.1", 5678)
|
|
||||||
|
|
||||||
asyncio.get_event_loop().run_until_complete(start_server)
|
|
||||||
asyncio.get_event_loop().run_forever()
|
|
Loading…
Reference in New Issue
Block a user