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