| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 CHECK(ip.AssignFromIPLiteral("::")); | 81 CHECK(ip.AssignFromIPLiteral("::")); |
| 82 | 82 |
| 83 net::QuicConfig config; | 83 net::QuicConfig config; |
| 84 net::QuicServer server( | 84 net::QuicServer server( |
| 85 CreateProofSource(line->GetSwitchValuePath("certificate_file"), | 85 CreateProofSource(line->GetSwitchValuePath("certificate_file"), |
| 86 line->GetSwitchValuePath("key_file")), | 86 line->GetSwitchValuePath("key_file")), |
| 87 config, net::QuicCryptoServerConfig::ConfigOptions(), | 87 config, net::QuicCryptoServerConfig::ConfigOptions(), |
| 88 net::QuicSupportedVersions()); | 88 net::QuicSupportedVersions()); |
| 89 server.SetStrikeRegisterNoStartupPeriod(); | 89 server.SetStrikeRegisterNoStartupPeriod(); |
| 90 | 90 |
| 91 int rc = server.Listen(net::IPEndPoint(ip, FLAGS_port)); | 91 int rc = server.CreateUDPSocketAndListen(net::IPEndPoint(ip, FLAGS_port)); |
| 92 if (rc < 0) { | 92 if (rc < 0) { |
| 93 return 1; | 93 return 1; |
| 94 } | 94 } |
| 95 | 95 |
| 96 while (1) { | 96 while (1) { |
| 97 server.WaitForEvents(); | 97 server.WaitForEvents(); |
| 98 } | 98 } |
| 99 } | 99 } |
| OLD | NEW |