'Stop the current SAMP Hub instance and delete the lock file.'

def stop(self):

    if (not self._is_running):
        return
    log.info(u'Hub    is    stopping...')
    self._notify_shutdown()
    self._is_running = False
    if (self._lockfile and os.path.isfile(self._lockfile)):
        lockfiledict = read_lockfile(self._lockfile)
        if (lockfiledict[u'samp.secret'] == self._hub_secret):
            os.remove(self._lockfile)
    self._lockfile = None
    self._join_all_threads(timeout=10.0)
    self._hub_msg_id_counter = 0
    self._hub_secret = self._create_secret_code()
    self._hub_public_id = u''
    self._metadata = {}
    self._private_keys = {}
    self._mtype2ids = {}
    self._id2mtypes = {}
    self._xmlrpc_endpoints = {}
    self._last_activity_time = None
    log.info(u'Hub    stopped.')
