formating
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
import asyncio
|
||||
import websockets
|
||||
|
||||
|
||||
async def hello():
|
||||
uri = "ws://localhost:50005/messages"
|
||||
async with websockets.connect(uri) as websocket:
|
||||
name = "Andreas"
|
||||
uri = "ws://localhost:50005/messages"
|
||||
async with websockets.connect(uri) as websocket:
|
||||
name = "Andreas"
|
||||
|
||||
await websocket.send(name)
|
||||
print(f"> {name}")
|
||||
await websocket.send(name)
|
||||
print(f"> {name}")
|
||||
|
||||
while True:
|
||||
greeting = await websocket.recv()
|
||||
print(f"< {greeting}")
|
||||
if greeting == "bye":
|
||||
break
|
||||
while True:
|
||||
greeting = await websocket.recv()
|
||||
print(f"< {greeting}")
|
||||
if greeting == "bye":
|
||||
break
|
||||
|
||||
print("out of here")
|
||||
|
||||
print('out of here')
|
||||
|
||||
asyncio.get_event_loop().run_until_complete(hello())
|
||||
|
||||
Reference in New Issue
Block a user