From e27360efc8114e8eca7d6b6a93bdeb5b053a53fe Mon Sep 17 00:00:00 2001 From: ThatXliner Date: Thu, 4 Jan 2024 12:50:27 -0800 Subject: [PATCH] Revert ":recycle: Moved trash message up" This reverts commit fd2674c7afe141f828b1345359fe6d6e1dbf333f. --- aioudp/client.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/aioudp/client.py b/aioudp/client.py index 7615188..bff9f7e 100644 --- a/aioudp/client.py +++ b/aioudp/client.py @@ -14,16 +14,6 @@ class _ClientProtocol(asyncio.DatagramProtocol): msg_queue: asyncio.Queue[None | bytes] - def connection_made( - self, - transport: asyncio.DatagramTransport, # type: ignore[override] - # I am aware of the Liskov subsitution principle - # but asyncio.DatagramProtocol had this function signature - ) -> None: - # This is to make sure that the connection works - # See https://github.com/ThatXliner/aioudp/pull/3 for more information - transport.sendto(b"trash") - def datagram_received(self, data: bytes, _: connection.AddrType) -> None: self.msg_queue.put_nowait(data) @@ -73,6 +63,9 @@ async def connect(host: str, port: int) -> AsyncIterator[connection.Connection]: get_remote_addr=functools.partial(transport.get_extra_info, "peername"), ) try: + # This is to make sure that the connection works + # See https://github.com/ThatXliner/aioudp/pull/3 for more information + await conn.send(b"trash") yield conn finally: transport.close()