blob: 541f6f9e13eff207a04412b715f5d27e72ccca91 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// A binary wrapper for QuicServer. It listens forever on --port
6// (default 6121) until it's killed or ctrl-cd to death.
7
8#include <vector>
9
dschinazi8ae60012019-04-04 18:07:27 -070010#include "net/third_party/quiche/src/quic/core/quic_versions.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050011#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
rch16478ed2019-05-20 08:12:59 -070012#include "net/third_party/quiche/src/quic/tools/quic_epoll_server_factory.h"
rch034c98c2019-05-17 15:46:09 -070013#include "net/third_party/quiche/src/quic/tools/quic_toy_server.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050014
QUICHE teama6ef0a62019-03-07 20:34:33 -050015int main(int argc, char* argv[]) {
16 const char* usage = "Usage: quic_server [options]";
vasilvvc48c8712019-03-11 13:38:16 -070017 std::vector<std::string> non_option_args =
QUICHE teama6ef0a62019-03-07 20:34:33 -050018 quic::QuicParseCommandLineFlags(usage, argc, argv);
19 if (!non_option_args.empty()) {
20 quic::QuicPrintCommandLineFlagHelp(usage);
21 exit(0);
22 }
23
rch034c98c2019-05-17 15:46:09 -070024 quic::QuicToyServer::MemoryCacheBackendFactory backend_factory;
rch16478ed2019-05-20 08:12:59 -070025 quic::QuicEpollServerFactory server_factory;
rch034c98c2019-05-17 15:46:09 -070026 quic::QuicToyServer server(&backend_factory, &server_factory);
27 return server.Start();
QUICHE teama6ef0a62019-03-07 20:34:33 -050028}