Write all data after paired stream closed.
This commit is contained in:
parent
add7a122ac
commit
543d6db55a
1 changed files with 4 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue