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

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: Address further comments 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
index 2d349ac4792112764edcafb1c17976d6485f8d0b..71ddc253dd7cb07d53148a4bbf78e0ea5028c633 100644
--- a/net/tools/quic/quic_server_bin.cc
+++ b/net/tools/quic/quic_server_bin.cc
@@ -11,13 +11,14 @@
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/logging.h"
+#include "base/run_loop.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"
+#include "net/quic/quic_in_memory_cache.h"
+#include "net/quic/quic_protocol.h"
+#include "net/quic/quic_server.h"
// The port the quic server will listen on.
-
int32 FLAGS_port = 6121;
int main(int argc, char *argv[]) {
@@ -42,8 +43,8 @@ int main(int argc, char *argv[]) {
}
if (line->HasSwitch("quic_in_memory_cache_dir")) {
- net::tools::FLAGS_quic_in_memory_cache_dir =
- line->GetSwitchValueASCII("quic_in_memory_cache_dir");
+ net::g_quic_in_memory_cache_dir =
+ line->GetSwitchValueNative("quic_in_memory_cache_dir");
wtc 2014/06/20 21:40:50 Why change GetSwitchValueASCII to GetSwitchValueNa
dmziegler 2014/06/23 18:31:25 Windows compatibility (wstring filenames).
}
if (line->HasSwitch("port")) {
@@ -55,18 +56,22 @@ int main(int argc, char *argv[]) {
base::AtExitManager exit_manager;
+ base::MessageLoopForIO message_loop;
+
net::IPAddressNumber ip;
CHECK(net::ParseIPLiteralToNumber("::", &ip));
- net::tools::QuicServer server;
+ net::QuicConfig config;
+ config.SetDefaults();
- if (!server.Listen(net::IPEndPoint(ip, FLAGS_port))) {
- return 1;
- }
+ net::QuicServer server(config, net::QuicSupportedVersions());
- while (1) {
- server.WaitForEvents();
+ int rc = server.Listen(net::IPEndPoint(ip, FLAGS_port));
+ if (rc < 0) {
+ return -rc;
wtc 2014/06/20 21:40:50 IMPORTANT: the main() function can only return a v
dmziegler 2014/06/23 18:31:25 I'm leaving the error code for now in case it's us
}
+ base::RunLoop().Run();
+
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