Can it be related to this issue? http://bugs.python.org/issue24539
See the fix: https://github.com/python/asyncio/commit/ce3ad816a2ef9456b4b1c26b99dfc85ea1236811 Victor 2015-07-15 16:38 GMT+02:00 Gustavo Carneiro <[email protected]>: > I have a simple server that uses asyncio StreamWriter to continually send > data to a client. The problem I have is that, if a client disconnects my > code is unaware and continues to send data. asyncio just prints a useless > "write:socket.send() raised exception" warning. > > Given a StreamWriter, how to handle disconnections? I've been searching, > and could find no way: > > 1. There is no is_closed() method in StreamWriter > > 2. There is a StreamWriter.transport property, but also there is no > is_closed() method in the Transport; > > IMHO, if a transport is closed StreamWriter.write() should simply raise a > well known exception. Thoughts? > > -- > Gustavo J. A. M. Carneiro > Gambit Research > "The universe is always one step beyond logic." -- Frank Herbert
