code: def __die(self, synchronous=False):
          
          already_killed = self.__killed
          self.__killed = True
          if self.__id and not already_killed:
              if self.__exhaust and self.__exhaust_mgr:
                  # If this is an exhaust cursor and we haven't completely
                  # exhausted the result set we *must* close the socket
                  # to stop the server from sending more data.
                  self.__exhaust_mgr.sock.close()
              else:
                  address = _CursorAddress(
                      self.__address, self.__collection.full_name)
                  if synchronous:
                      self.__collection.database.client._close_cursor_now(
                          self.__id, address, session=self.__session)
                  else:
                      # The cursor will be closed later in a different session.
                      self.__collection.database.client._close_cursor(
                          self.__id, address)
          if self.__exhaust and self.__exhaust_mgr:
              self.__exhaust_mgr.close()
          if self.__session and not self.__explicit_session:
              self.__session._end_session(lock=synchronous)
              self.__session = None
docs: Closes this cursor.