def METHOD_NAME(make_kresd_silent_sock, glength, gcount, delay, query_before):
    """Flood resolver with prefixed garbage."""
    sock1 = make_kresd_silent_sock()
    if query_before:
        utils.ping_alive(sock1)
    gbuff = utils.get_prefixed_garbage(glength)
    buff = gbuff * gcount
    end_time = time.time() + utils.MAX_TIMEOUT
    with utils.expect_kresd_close(rst_ok=True):  # connection must be closed
        while time.time() < end_time:
            sock1.sendall(buff)
            time.sleep(delay)
    sock2 = make_kresd_silent_sock()
    utils.ping_alive(sock2)  # resolver must stay alive