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

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

Issue 131743009: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use size_t instead of int to fix win_x64 compile error Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « net/tools/quic/quic_server.h ('k') | net/tools/quic/quic_server_session.h » ('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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 if (getsockname(fd_, storage.addr, &storage.addr_len) != 0 || 140 if (getsockname(fd_, storage.addr, &storage.addr_len) != 0 ||
141 !server_address.FromSockAddr(storage.addr, storage.addr_len)) { 141 !server_address.FromSockAddr(storage.addr, storage.addr_len)) {
142 LOG(ERROR) << "Unable to get self address. Error: " << strerror(errno); 142 LOG(ERROR) << "Unable to get self address. Error: " << strerror(errno);
143 return false; 143 return false;
144 } 144 }
145 port_ = server_address.port(); 145 port_ = server_address.port();
146 LOG(INFO) << "Kernel assigned port is " << port_; 146 LOG(INFO) << "Kernel assigned port is " << port_;
147 } 147 }
148 148
149 epoll_server_.RegisterFD(fd_, this, kEpollFlags); 149 epoll_server_.RegisterFD(fd_, this, kEpollFlags);
150 dispatcher_.reset(new QuicDispatcher(config_, crypto_config_, 150 dispatcher_.reset(new QuicDispatcher(
151 supported_versions_, 151 config_, crypto_config_, supported_versions_, &epoll_server_));
152 fd_, &epoll_server_)); 152 dispatcher_->Initialize(fd_);
153 153
154 return true; 154 return true;
155 } 155 }
156 156
157 void QuicServer::WaitForEvents() { 157 void QuicServer::WaitForEvents() {
158 epoll_server_.WaitForEventsAndExecuteCallbacks(); 158 epoll_server_.WaitForEventsAndExecuteCallbacks();
159 } 159 }
160 160
161 void QuicServer::Shutdown() { 161 void QuicServer::Shutdown() {
162 // Before we shut down the epoll server, give all active sessions a chance to 162 // Before we shut down the epoll server, give all active sessions a chance to
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 QuicEncryptedPacket packet(buf, bytes_read, false); 213 QuicEncryptedPacket packet(buf, bytes_read, false);
214 214
215 IPEndPoint server_address(server_ip, port); 215 IPEndPoint server_address(server_ip, port);
216 dispatcher->ProcessPacket(server_address, client_address, packet); 216 dispatcher->ProcessPacket(server_address, client_address, packet);
217 217
218 return true; 218 return true;
219 } 219 }
220 220
221 } // namespace tools 221 } // namespace tools
222 } // namespace net 222 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_server.h ('k') | net/tools/quic/quic_server_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698