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" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 return rc; | 119 return rc; |
120 } | 120 } |
121 | 121 |
122 DVLOG(1) << "Listening on " << server_address_.ToString(); | 122 DVLOG(1) << "Listening on " << server_address_.ToString(); |
123 | 123 |
124 socket_.swap(socket); | 124 socket_.swap(socket); |
125 | 125 |
126 dispatcher_.reset(new QuicSimpleDispatcher( | 126 dispatcher_.reset(new QuicSimpleDispatcher( |
127 config_, &crypto_config_, &version_manager_, | 127 config_, &crypto_config_, &version_manager_, |
128 std::unique_ptr<QuicConnectionHelperInterface>(helper_), | 128 std::unique_ptr<QuicConnectionHelperInterface>(helper_), |
129 std::unique_ptr<QuicServerSessionBase::Helper>( | 129 std::unique_ptr<QuicCryptoServerStream::Helper>( |
130 new QuicSimpleServerSessionHelper(QuicRandom::GetInstance())), | 130 new QuicSimpleServerSessionHelper(QuicRandom::GetInstance())), |
131 std::unique_ptr<QuicAlarmFactory>(alarm_factory_))); | 131 std::unique_ptr<QuicAlarmFactory>(alarm_factory_))); |
132 QuicSimpleServerPacketWriter* writer = | 132 QuicSimpleServerPacketWriter* writer = |
133 new QuicSimpleServerPacketWriter(socket_.get(), dispatcher_.get()); | 133 new QuicSimpleServerPacketWriter(socket_.get(), dispatcher_.get()); |
134 dispatcher_->InitializeWithWriter(writer); | 134 dispatcher_->InitializeWithWriter(writer); |
135 | 135 |
136 StartReading(); | 136 StartReading(); |
137 | 137 |
138 return OK; | 138 return OK; |
139 } | 139 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 QuicReceivedPacket packet(read_buffer_->data(), result, | 199 QuicReceivedPacket packet(read_buffer_->data(), result, |
200 helper_->GetClock()->Now(), false); | 200 helper_->GetClock()->Now(), false); |
201 dispatcher_->ProcessPacket(server_address_, client_address_, packet); | 201 dispatcher_->ProcessPacket(server_address_, client_address_, packet); |
202 | 202 |
203 StartReading(); | 203 StartReading(); |
204 } | 204 } |
205 | 205 |
206 } // namespace net | 206 } // namespace net |
OLD | NEW |