asyncins / aiowebsocket

Async WebSocket Client. Advantage: Flexible Lighter and Faster
321 stars 55 forks source link

# it would see an error when the socket is closed. #6

Open shdows opened 5 years ago

shdows commented 5 years ago

async with AioWebSocket(uri) as aws: converse = aws.manipulator message = b'AioWebSocket - Async WebSocket Client' while True: await converse.send(message) print('{time}-Client send: {message}' .format(time=datetime.now().strftime('%Y-%m-%d %H:%M:%S'), message=message)) The above code can not see an error when the socket is closed. need to call below code: awati converse.writer.drain()

I think this code can add to send method