OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // A binary wrapper for QuicServer. It listens forever on --port | 5 // A binary wrapper for QuicServer. It listens forever on --port |
6 // (default 6121) until it's killed or ctrl-cd to death. | 6 // (default 6121) until it's killed or ctrl-cd to death. |
7 | 7 |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "net/base/ip_endpoint.h" | 11 #include "net/base/ip_endpoint.h" |
12 #include "net/tools/quic/quic_server.h" | 12 #include "net/tools/quic/quic_server.h" |
13 | 13 |
14 // The port the quic server will listen on. | 14 // The port the quic server will listen on. |
15 int32 FLAGS_port = 6121; | 15 int32 FLAGS_port = 6121; |
16 | 16 |
17 int main(int argc, char *argv[]) { | 17 int main(int argc, char *argv[]) { |
18 CommandLine::Init(argc, argv); | 18 CommandLine::Init(argc, argv); |
19 | 19 |
20 base::AtExitManager exit_manager; | 20 base::AtExitManager exit_manager; |
21 | 21 |
22 net::IPAddressNumber ip; | 22 net::IPAddressNumber ip; |
23 CHECK(net::ParseIPLiteralToNumber("::", &ip)); | 23 CHECK(net::ParseIPLiteralToNumber("::", &ip)); |
24 | 24 |
25 net::QuicServer server; | 25 net::tools::QuicServer server; |
26 | 26 |
27 if (!server.Listen(net::IPEndPoint(ip, FLAGS_port))) { | 27 if (!server.Listen(net::IPEndPoint(ip, FLAGS_port))) { |
28 return 1; | 28 return 1; |
29 } | 29 } |
30 | 30 |
31 while (1) { | 31 while (1) { |
32 server.WaitForEvents(); | 32 server.WaitForEvents(); |
33 } | 33 } |
34 | 34 |
35 return 0; | 35 return 0; |
36 } | 36 } |
OLD | NEW |