Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1705)

Unified Diff: net/tools/quic/quic_server_bin.cc

Issue 340433002: Port QuicServer to Chrome network stack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build quic_ported_server on other platforms too Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« net/quic/quic_server_test.cc ('K') | « net/quic/quic_server_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_server_bin.cc
diff --git a/net/tools/quic/quic_server_bin.cc b/net/tools/quic/quic_server_bin.cc
deleted file mode 100644
index 2d349ac4792112764edcafb1c17976d6485f8d0b..0000000000000000000000000000000000000000
--- a/net/tools/quic/quic_server_bin.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// A binary wrapper for QuicServer. It listens forever on --port
-// (default 6121) until it's killed or ctrl-cd to death.
-
-#include <iostream>
-
-#include "base/at_exit.h"
-#include "base/basictypes.h"
-#include "base/command_line.h"
-#include "base/logging.h"
-#include "base/strings/string_number_conversions.h"
-#include "net/base/ip_endpoint.h"
-#include "net/tools/quic/quic_in_memory_cache.h"
-#include "net/tools/quic/quic_server.h"
-
-// The port the quic server will listen on.
-
-int32 FLAGS_port = 6121;
-
-int main(int argc, char *argv[]) {
- base::CommandLine::Init(argc, argv);
- base::CommandLine* line = base::CommandLine::ForCurrentProcess();
-
- logging::LoggingSettings settings;
- settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
- CHECK(logging::InitLogging(settings));
-
- if (line->HasSwitch("h") || line->HasSwitch("help")) {
- const char* help_str =
- "Usage: quic_server [options]\n"
- "\n"
- "Options:\n"
- "-h, --help show this help message and exit\n"
- "--port=<port> specify the port to listen on\n"
- "--quic_in_memory_cache_dir directory containing response data\n"
- " to load\n";
- std::cout << help_str;
- exit(0);
- }
-
- if (line->HasSwitch("quic_in_memory_cache_dir")) {
- net::tools::FLAGS_quic_in_memory_cache_dir =
- line->GetSwitchValueASCII("quic_in_memory_cache_dir");
- }
-
- if (line->HasSwitch("port")) {
- int port;
- if (base::StringToInt(line->GetSwitchValueASCII("port"), &port)) {
- FLAGS_port = port;
- }
- }
-
- base::AtExitManager exit_manager;
-
- net::IPAddressNumber ip;
- CHECK(net::ParseIPLiteralToNumber("::", &ip));
-
- net::tools::QuicServer server;
-
- if (!server.Listen(net::IPEndPoint(ip, FLAGS_port))) {
- return 1;
- }
-
- while (1) {
- server.WaitForEvents();
- }
-
- return 0;
-}
« net/quic/quic_server_test.cc ('K') | « net/quic/quic_server_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698