Skip to content
Snippets Groups Projects
Commit 34e1af28 authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers Committed by Joseph Walton-Rivers
Browse files

client stress test code

parent 84a21184
No related branches found
No related tags found
No related merge requests found
Pipeline #3469 failed
#! /usr/bin/env python3
import asyncio
from websockets import connect
async def hello(uri):
async with connect(uri) as websocket:
test = await websocket.recv()
print( test )
await websocket.send("{\"type\": \"setup\", \"data\": {\"name\": \"Test Account\"}}")
test2 = await websocket.recv()
print( test2 )
while True:
output = await websocket.recv()
print( output )
def hello_lots():
loop = asyncio.get_event_loop()
try:
for _ in range(0, 10000):
asyncio.ensure_future(hello("ws://localhost:8081"))
loop.run_forever()
except KeyboardInterrupt:
pass
finally:
print("Closing Loop")
loop.close()
hello_lots()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment