Write all data after paired stream closed.

This commit is contained in:
ayanamist 2013-02-28 11:05:14 +08:00
parent add7a122ac
commit 543d6db55a

View file

@ -66,7 +66,10 @@ class PairedStream(iostream.IOStream):
def on_close(self):
remote = getattr(self, "remote")
if isinstance(remote, PairedStream) and not remote.closed():
remote.close()
if remote.writing():
remote.write("", callback=remote.close())
else:
remote.close()
class ConnHandler(PairedStream):