diff --git a/telethon/network/connection/tcpabridged.py b/telethon/network/connection/tcpabridged.py index cff295ae..c9350da9 100644 --- a/telethon/network/connection/tcpabridged.py +++ b/telethon/network/connection/tcpabridged.py @@ -11,7 +11,8 @@ class ConnectionTcpAbridged(Connection): """ async def connect(self, timeout=None, ssl=None): await super().connect(timeout=timeout, ssl=ssl) - await self.send(b'\xef') + self._writer.write(b'\xef') + await self._writer.drain() def _write(self, data): """ diff --git a/telethon/network/connection/tcpintermediate.py b/telethon/network/connection/tcpintermediate.py index 322b1e8f..59467be7 100644 --- a/telethon/network/connection/tcpintermediate.py +++ b/telethon/network/connection/tcpintermediate.py @@ -10,7 +10,8 @@ class ConnectionTcpIntermediate(Connection): """ async def connect(self, timeout=None, ssl=None): await super().connect(timeout=timeout, ssl=ssl) - await self.send(b'\xee\xee\xee\xee') + self._writer.write(b'\xee\xee\xee\xee') + await self._writer.drain() def _send(self, data): self._writer.write(struct.pack('