| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <iostream> | 8 #include <iostream> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 LOG(ERROR) << "--port must be an integer\n"; | 55 LOG(ERROR) << "--port must be an integer\n"; |
| 56 return 1; | 56 return 1; |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 | 59 |
| 60 net::IPAddressNumber ip; | 60 net::IPAddressNumber ip; |
| 61 CHECK(net::ParseIPLiteralToNumber("::", &ip)); | 61 CHECK(net::ParseIPLiteralToNumber("::", &ip)); |
| 62 | 62 |
| 63 net::QuicConfig config; | 63 net::QuicConfig config; |
| 64 net::tools::QuicServer server(config, net::QuicSupportedVersions()); | 64 net::tools::QuicServer server(config, net::QuicSupportedVersions()); |
| 65 server.SetStrikeRegisterNoStartupPeriod(); |
| 65 | 66 |
| 66 int rc = server.Listen(net::IPEndPoint(ip, FLAGS_port)); | 67 int rc = server.Listen(net::IPEndPoint(ip, FLAGS_port)); |
| 67 if (rc < 0) { | 68 if (rc < 0) { |
| 68 return 1; | 69 return 1; |
| 69 } | 70 } |
| 70 | 71 |
| 71 while (1) { | 72 while (1) { |
| 72 server.WaitForEvents(); | 73 server.WaitForEvents(); |
| 73 } | 74 } |
| 74 } | 75 } |
| OLD | NEW |