| 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 toy server, which listens on a specified address for QUIC traffic and | 5 // A toy server, which listens on a specified address for QUIC traffic and |
| 6 // handles incoming responses. | 6 // handles incoming responses. |
| 7 | 7 |
| 8 #ifndef NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ | 8 #ifndef NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ |
| 9 #define NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ | 9 #define NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
| 15 #include "net/base/ip_endpoint.h" | 15 #include "net/base/ip_endpoint.h" |
| 16 #include "net/log/net_log.h" | 16 #include "net/log/net_log.h" |
| 17 #include "net/quic/crypto/quic_crypto_server_config.h" | 17 #include "net/quic/crypto/quic_crypto_server_config.h" |
| 18 #include "net/quic/quic_chromium_alarm_factory.h" |
| 18 #include "net/quic/quic_chromium_connection_helper.h" | 19 #include "net/quic/quic_chromium_connection_helper.h" |
| 19 #include "net/quic/quic_clock.h" | 20 #include "net/quic/quic_clock.h" |
| 20 #include "net/quic/quic_config.h" | 21 #include "net/quic/quic_config.h" |
| 21 | 22 |
| 22 namespace net { | 23 namespace net { |
| 23 | 24 |
| 24 class UDPServerSocket; | 25 class UDPServerSocket; |
| 25 | 26 |
| 26 | 27 |
| 27 class QuicDispatcher; | 28 class QuicDispatcher; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 67 |
| 67 // Accepts data from the framer and demuxes clients to sessions. | 68 // Accepts data from the framer and demuxes clients to sessions. |
| 68 std::unique_ptr<QuicDispatcher> dispatcher_; | 69 std::unique_ptr<QuicDispatcher> dispatcher_; |
| 69 | 70 |
| 70 // Used by the helper_ to time alarms. | 71 // Used by the helper_ to time alarms. |
| 71 QuicClock clock_; | 72 QuicClock clock_; |
| 72 | 73 |
| 73 // Used to manage the message loop. Owned by dispatcher_. | 74 // Used to manage the message loop. Owned by dispatcher_. |
| 74 QuicChromiumConnectionHelper* helper_; | 75 QuicChromiumConnectionHelper* helper_; |
| 75 | 76 |
| 77 // Used to manage the message loop. Owned by dispatcher_. |
| 78 QuicChromiumAlarmFactory* alarm_factory_; |
| 79 |
| 76 // Listening socket. Also used for outbound client communication. | 80 // Listening socket. Also used for outbound client communication. |
| 77 std::unique_ptr<UDPServerSocket> socket_; | 81 std::unique_ptr<UDPServerSocket> socket_; |
| 78 | 82 |
| 79 // config_ contains non-crypto parameters that are negotiated in the crypto | 83 // config_ contains non-crypto parameters that are negotiated in the crypto |
| 80 // handshake. | 84 // handshake. |
| 81 QuicConfig config_; | 85 QuicConfig config_; |
| 82 // crypto_config_ contains crypto parameters for the handshake. | 86 // crypto_config_ contains crypto parameters for the handshake. |
| 83 QuicCryptoServerConfig crypto_config_; | 87 QuicCryptoServerConfig crypto_config_; |
| 84 | 88 |
| 85 // This vector contains QUIC versions which we currently support. | 89 // This vector contains QUIC versions which we currently support. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 109 NetLog net_log_; | 113 NetLog net_log_; |
| 110 | 114 |
| 111 base::WeakPtrFactory<QuicSimpleServer> weak_factory_; | 115 base::WeakPtrFactory<QuicSimpleServer> weak_factory_; |
| 112 | 116 |
| 113 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServer); | 117 DISALLOW_COPY_AND_ASSIGN(QuicSimpleServer); |
| 114 }; | 118 }; |
| 115 | 119 |
| 116 } // namespace net | 120 } // namespace net |
| 117 | 121 |
| 118 #endif // NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ | 122 #endif // NET_QUIC_TOOLS_QUIC_SIMPLE_SERVER_H_ |
| OLD | NEW |