OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_server.h" | 5 #include "net/tools/quic/quic_server.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <features.h> | 8 #include <features.h> |
9 #include <netinet/in.h> | 9 #include <netinet/in.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 dispatcher_->Initialize(fd_); | 159 dispatcher_->Initialize(fd_); |
160 | 160 |
161 return true; | 161 return true; |
162 } | 162 } |
163 | 163 |
164 QuicDispatcher* QuicServer::CreateQuicDispatcher() { | 164 QuicDispatcher* QuicServer::CreateQuicDispatcher() { |
165 return new QuicDispatcher( | 165 return new QuicDispatcher( |
166 config_, | 166 config_, |
167 crypto_config_, | 167 crypto_config_, |
168 supported_versions_, | 168 supported_versions_, |
| 169 new QuicDispatcher::DefaultPacketWriterFactory(), |
169 &epoll_server_); | 170 &epoll_server_); |
170 } | 171 } |
171 | 172 |
172 void QuicServer::WaitForEvents() { | 173 void QuicServer::WaitForEvents() { |
173 epoll_server_.WaitForEventsAndExecuteCallbacks(); | 174 epoll_server_.WaitForEventsAndExecuteCallbacks(); |
174 } | 175 } |
175 | 176 |
176 void QuicServer::Shutdown() { | 177 void QuicServer::Shutdown() { |
177 // Before we shut down the epoll server, give all active sessions a chance to | 178 // Before we shut down the epoll server, give all active sessions a chance to |
178 // notify clients that they're closing. | 179 // notify clients that they're closing. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 QuicEncryptedPacket packet(buf, bytes_read, false); | 229 QuicEncryptedPacket packet(buf, bytes_read, false); |
229 | 230 |
230 IPEndPoint server_address(server_ip, port); | 231 IPEndPoint server_address(server_ip, port); |
231 processor->ProcessPacket(server_address, client_address, packet); | 232 processor->ProcessPacket(server_address, client_address, packet); |
232 | 233 |
233 return true; | 234 return true; |
234 } | 235 } |
235 | 236 |
236 } // namespace tools | 237 } // namespace tools |
237 } // namespace net | 238 } // namespace net |
OLD | NEW |