diff --git a/ib_insync/connection.py b/ib_insync/connection.py
index <HASH>..<HASH> 100644
--- a/ib_insync/connection.py
+++ b/ib_insync/connection.py
@@ -39,6 +39,7 @@ class Connection(asyncio.Protocol):
 
     def disconnect(self):
         if self.transport:
+            self.transport.write_eof()
             self.transport.close()
 
     def isConnected(self):
Write EOF before closing the socket connection, fixes #<I>