Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(830)

Side by Side Diff: net/tools/quic/quic_server.cc

Issue 467963002: Refactoring: Create per-connection packet writers in QuicDispatcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase onto ToT Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_server.h ('k') | net/tools/quic/quic_server_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 dispatcher_->Initialize(fd_); 158 dispatcher_->Initialize(fd_);
159 159
160 return true; 160 return true;
161 } 161 }
162 162
163 QuicDispatcher* QuicServer::CreateQuicDispatcher() { 163 QuicDispatcher* QuicServer::CreateQuicDispatcher() {
164 return new QuicDispatcher( 164 return new QuicDispatcher(
165 config_, 165 config_,
166 crypto_config_, 166 crypto_config_,
167 supported_versions_, 167 supported_versions_,
168 new QuicDispatcher::DefaultPacketWriterFactory(),
168 &epoll_server_); 169 &epoll_server_);
169 } 170 }
170 171
171 void QuicServer::WaitForEvents() { 172 void QuicServer::WaitForEvents() {
172 epoll_server_.WaitForEventsAndExecuteCallbacks(); 173 epoll_server_.WaitForEventsAndExecuteCallbacks();
173 } 174 }
174 175
175 void QuicServer::Shutdown() { 176 void QuicServer::Shutdown() {
176 // Before we shut down the epoll server, give all active sessions a chance to 177 // Before we shut down the epoll server, give all active sessions a chance to
177 // notify clients that they're closing. 178 // notify clients that they're closing.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 QuicEncryptedPacket packet(buf, bytes_read, false); 228 QuicEncryptedPacket packet(buf, bytes_read, false);
228 229
229 IPEndPoint server_address(server_ip, port); 230 IPEndPoint server_address(server_ip, port);
230 processor->ProcessPacket(server_address, client_address, packet); 231 processor->ProcessPacket(server_address, client_address, packet);
231 232
232 return true; 233 return true;
233 } 234 }
234 235
235 } // namespace tools 236 } // namespace tools
236 } // namespace net 237 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_server.h ('k') | net/tools/quic/quic_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698