async def close(self, *, force_after: int = None):
        """Closes the connection and waits for it to be closed.
        We try to flush buffered data to the wire, which can take some time.
        """
        if self.session:
            await self.session.close(force_after=force_after)
        # monitor_connection will cancel tasks
Closes the connection and waits for it to be closed.
        We try to flush buffered data to the wire, which can take some time.
        
electrum/interface.py