':return: True if the plugin is correctly configured to run.'

def _correctly_configured(self):

    listen_address = self._listen_address
    listen_port = self._listen_port
    if (listen_address and listen_port):
        with self._plugin_lock:
            if webserver.is_running(listen_address, listen_port):
                return (True, CONFIG_OK)
            s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
            bind_args = (listen_address, listen_port)
            try:
                s.bind(bind_args)
            except socket.error as se:
                msg = 'Failed    to    bind    to    address    %s:%s,    error:    %s'
                fmt_args = list(bind_args)
                fmt_args.append(se)
                return (False, (msg % tuple(fmt_args)))
            finally:
                s.close()
                del s
            return (True, CONFIG_OK)
    return (False, 'Listen    address    and    port    need    to    be    configured')
