diff options
Diffstat (limited to 'kvmd/apps/vnc/rfb/stream.py')
-rw-r--r-- | kvmd/apps/vnc/rfb/stream.py | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/kvmd/apps/vnc/rfb/stream.py b/kvmd/apps/vnc/rfb/stream.py index 3f2d38b8..235a32e4 100644 --- a/kvmd/apps/vnc/rfb/stream.py +++ b/kvmd/apps/vnc/rfb/stream.py @@ -27,6 +27,8 @@ import struct from typing import Tuple from typing import Any +from .... import aiotools + from .errors import RfbConnectionError @@ -35,18 +37,6 @@ def rfb_format_remote(writer: asyncio.StreamWriter) -> str: return "[%s]:%d" % (writer.transport.get_extra_info("peername")[:2]) -async def rfb_close_writer(writer: asyncio.StreamWriter) -> bool: - closing = writer.is_closing() - if not closing: - writer.transport.abort() # type: ignore - writer.close() - try: - await writer.wait_closed() - except Exception: - pass - return (not closing) - - class RfbClientStream: def __init__(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None: self.__reader = reader @@ -145,4 +135,4 @@ class RfbClientStream: self.__writer = ssl_writer async def _close(self) -> None: - await rfb_close_writer(self.__writer) + await aiotools.close_writer(self.__writer) |