From aa5aed5fbc4def056ede6babb53968773b275c8c Mon Sep 17 00:00:00 2001 From: alemidev Date: Fri, 6 May 2022 18:44:25 +0200 Subject: [PATCH] dispatcher more debuggy too --- src/aiocraft/dispatcher.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/aiocraft/dispatcher.py b/src/aiocraft/dispatcher.py index 920e6f8..5569e30 100644 --- a/src/aiocraft/dispatcher.py +++ b/src/aiocraft/dispatcher.py @@ -148,7 +148,8 @@ class Dispatcher: if reader and writer: self._down, self._up = reader, writer - else: + else: # TODO put a timeout here and throw exception + self.logger.debug("Attempting to connect to %s:%d", self.host, self.port) self._down, self._up = await asyncio.open_connection( host=self.host, port=self.port, @@ -169,6 +170,7 @@ class Dispatcher: if not self._up.is_closing() and self._up.can_write_eof(): try: self._up.write_eof() + self.logger.debug("Wrote EOF on socket") except OSError as e: self.logger.error("Could not write EOF : %s", str(e)) self._up.close()