docs: def _close(self):
          """close the socket and cleanup"""
          callback = self.__callback
          self.__callback = None
          try:
              if callback:
                  callback(None, InterfaceError('connection closed'))
          finally:
              # Flush the job queue, don't call the callbacks associated with the remaining jobs
              # since they have already been called as error callback on connection closing
              self.__job_queue = []
              self.__alive = False
              self.__stream.close()