Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/asyncio/proactor_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def _force_close(self, exc):
self._loop.call_soon(self._call_connection_lost, exc)

def _call_connection_lost(self, exc):
if self._called_connection_lost:
return
try:
self._protocol.connection_lost(exc)
finally:
Expand All @@ -161,7 +163,6 @@ def _call_connection_lost(self, exc):
# cure it, but maybe using DisconnectEx() would be better.
if hasattr(self._sock, 'shutdown') and self._sock.fileno() != -1:
self._sock.shutdown(socket.SHUT_RDWR)
Comment thread
Fidget-Spinner marked this conversation as resolved.
self._sock.close()
Comment thread
Fidget-Spinner marked this conversation as resolved.
self._sock = None
server = self._server
if server is not None:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix :meth:`asyncio.StreamWriter.drain` to call ``protocol.connection_lost``
callback only once on Windows.