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 #include "net/tools/quic/quic_simple_server.h" | 5 #include "net/tools/quic/quic_simple_server.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
12 #include "net/base/ip_endpoint.h" | 12 #include "net/base/ip_endpoint.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
14 #include "net/log/net_log_source.h" | 14 #include "net/log/net_log_source.h" |
15 #include "net/quic/core/crypto/crypto_handshake.h" | 15 #include "net/quic/core/crypto/crypto_handshake.h" |
16 #include "net/quic/core/crypto/quic_random.h" | 16 #include "net/quic/core/crypto/quic_random.h" |
17 #include "net/quic/core/quic_crypto_stream.h" | 17 #include "net/quic/core/quic_crypto_stream.h" |
18 #include "net/quic/core/quic_data_reader.h" | 18 #include "net/quic/core/quic_data_reader.h" |
19 #include "net/quic/core/quic_protocol.h" | 19 #include "net/quic/core/quic_protocol.h" |
| 20 #include "net/socket/udp_server_socket.h" |
20 #include "net/tools/quic/quic_simple_dispatcher.h" | 21 #include "net/tools/quic/quic_simple_dispatcher.h" |
21 #include "net/tools/quic/quic_simple_per_connection_packet_writer.h" | 22 #include "net/tools/quic/quic_simple_per_connection_packet_writer.h" |
22 #include "net/tools/quic/quic_simple_server_packet_writer.h" | 23 #include "net/tools/quic/quic_simple_server_packet_writer.h" |
23 #include "net/tools/quic/quic_simple_server_session_helper.h" | 24 #include "net/tools/quic/quic_simple_server_session_helper.h" |
24 #include "net/udp/udp_server_socket.h" | |
25 | 25 |
26 namespace net { | 26 namespace net { |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 const char kSourceAddressTokenSecret[] = "secret"; | 30 const char kSourceAddressTokenSecret[] = "secret"; |
31 const size_t kNumSessionsToCreatePerSocketEvent = 16; | 31 const size_t kNumSessionsToCreatePerSocketEvent = 16; |
32 | 32 |
33 // Allocate some extra space so we can send an error if the client goes over | 33 // Allocate some extra space so we can send an error if the client goes over |
34 // the limit. | 34 // the limit. |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 | 199 |
200 QuicReceivedPacket packet(read_buffer_->data(), result, | 200 QuicReceivedPacket packet(read_buffer_->data(), result, |
201 helper_->GetClock()->Now(), false); | 201 helper_->GetClock()->Now(), false); |
202 dispatcher_->ProcessPacket(server_address_, client_address_, packet); | 202 dispatcher_->ProcessPacket(server_address_, client_address_, packet); |
203 | 203 |
204 StartReading(); | 204 StartReading(); |
205 } | 205 } |
206 | 206 |
207 } // namespace net | 207 } // namespace net |
OLD | NEW |