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

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

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 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
« no previous file with comments | « net/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_client_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 // A binary wrapper for QuicClient. 5 // A binary wrapper for QuicClient.
6 // Connects to a host using QUIC, and sends requests to the provided URLS. 6 // Connects to a host using QUIC, and sends requests to the provided URLS.
7 // 7 //
8 // Example usage: 8 // Example usage:
9 // quic_client --address=127.0.0.1 --port=6122 --hostname=www.google.com 9 // quic_client --address=127.0.0.1 --port=6122 --hostname=www.google.com
10 // http://www.google.com/index.html http://www.google.com/favicon.ico 10 // http://www.google.com/index.html http://www.google.com/favicon.ico
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 versions = net::QuicSupportedVersions(); 110 versions = net::QuicSupportedVersions();
111 } else { 111 } else {
112 versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version)); 112 versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version));
113 } 113 }
114 114
115 // Build the client, and try to connect. 115 // Build the client, and try to connect.
116 VLOG(1) << "Conecting to " << FLAGS_hostname << ":" << FLAGS_port 116 VLOG(1) << "Conecting to " << FLAGS_hostname << ":" << FLAGS_port
117 << " with supported versions " 117 << " with supported versions "
118 << QuicVersionVectorToString(versions); 118 << QuicVersionVectorToString(versions);
119 net::EpollServer epoll_server; 119 net::EpollServer epoll_server;
120 net::QuicConfig config;
121
122 // The default flow control window of 16 Kb is too small for practical
123 // purposes. Set it to the specified value, which has a large default.
124 config.SetInitialFlowControlWindowToSend(
125 FLAGS_flow_control_window_bytes);
126 config.SetInitialStreamFlowControlWindowToSend(
127 FLAGS_flow_control_window_bytes);
128 config.SetInitialSessionFlowControlWindowToSend(
129 FLAGS_flow_control_window_bytes);
130 120
131 net::tools::QuicClient client( 121 net::tools::QuicClient client(
132 net::IPEndPoint(addr, FLAGS_port), 122 net::IPEndPoint(addr, FLAGS_port),
133 net::QuicServerId(FLAGS_hostname, FLAGS_port, FLAGS_secure, 123 net::QuicServerId(FLAGS_hostname, FLAGS_port, FLAGS_secure,
134 net::PRIVACY_MODE_DISABLED), 124 net::PRIVACY_MODE_DISABLED),
135 versions, true, config, &epoll_server); 125 versions, true, &epoll_server);
136 126
137 client.Initialize(); 127 client.Initialize();
138 128
139 if (!client.Connect()) { 129 if (!client.Connect()) {
140 LOG(ERROR) << "Client failed to connect to host: " 130 LOG(ERROR) << "Client failed to connect to host: "
141 << FLAGS_hostname << ":" << FLAGS_port; 131 << FLAGS_hostname << ":" << FLAGS_port;
142 return 1; 132 return 1;
143 } 133 }
144 134
145 // Send a GET request for each supplied url. 135 // Send a GET request for each supplied url.
146 client.SendRequestsAndWaitForResponse(urls); 136 client.SendRequestsAndWaitForResponse(urls);
147 return 0; 137 return 0;
148 } 138 }
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client.cc ('k') | net/tools/quic/quic_client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698