blob: 6852d5f770b67bcadf3c433cce4590192faaaafd [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <lib/async-loop/cpp/loop.h>
#include <lib/async/cpp/task.h>
#include "garnet/bin/mdns/util/mdns_impl.h"
#include "garnet/bin/mdns/util/mdns_params.h"
#include "lib/fxl/command_line.h"
int main(int argc, const char** argv) {
fxl::CommandLine command_line = fxl::CommandLineFromArgcArgv(argc, argv);
mdns::MdnsParams params(command_line);
if (!params.is_valid()) {
return 1;
}
async::Loop loop(&kAsyncLoopConfigAttachToThread);
std::unique_ptr<component::StartupContext> startup_context =
component::StartupContext::CreateFromStartupInfo();
mdns::MdnsImpl impl(startup_context.get(), &params, [&loop]() {
async::PostTask(loop.dispatcher(), [&loop]() { loop.Quit(); });
});
loop.Run();
return 0;
}