def METHOD_NAME(self) -> None:
    """Close the base object and wait for the thread to terminate"""
    if self._open:
        self._open = False
        if self._drain_thread is not None:
            thread, self._drain_thread = self._drain_thread, None
            thread.join()
        socket.socket.METHOD_NAME(self)
        if self._logfile:
            self._logfile.METHOD_NAME()
            self._logfile = None