dispatcher more debuggy too

This commit is contained in:
əlemi 2022-05-06 18:44:25 +02:00
parent d36772b94d
commit aa5aed5fbc
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E

View file

@ -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()