| 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 // A toy client, which connects to a specified port and sends QUIC | 5 // A toy client, which connects to a specified port and sends QUIC |
| 6 // request to that endpoint. | 6 // request to that endpoint. |
| 7 | 7 |
| 8 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 8 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
| 9 #define NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 9 #define NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
| 10 | 10 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 | 195 |
| 196 QuicConfig* config() { return &config_; } | 196 QuicConfig* config() { return &config_; } |
| 197 | 197 |
| 198 void set_store_response(bool val) { store_response_ = val; } | 198 void set_store_response(bool val) { store_response_ = val; } |
| 199 | 199 |
| 200 size_t latest_response_code() const; | 200 size_t latest_response_code() const; |
| 201 const std::string& latest_response_headers() const; | 201 const std::string& latest_response_headers() const; |
| 202 const std::string& latest_response_body() const; | 202 const std::string& latest_response_body() const; |
| 203 | 203 |
| 204 // Change the initial maximum packet size of the connection. Has to be called |
| 205 // before Connect()/StartConnect() in order to have any effect. |
| 206 void set_initial_max_packet_length(QuicByteCount initial_max_packet_length) { |
| 207 initial_max_packet_length_ = initial_max_packet_length; |
| 208 } |
| 209 |
| 204 protected: | 210 protected: |
| 205 virtual QuicConnectionId GenerateConnectionId(); | 211 virtual QuicConnectionId GenerateConnectionId(); |
| 206 virtual QuicEpollConnectionHelper* CreateQuicConnectionHelper(); | 212 virtual QuicEpollConnectionHelper* CreateQuicConnectionHelper(); |
| 207 virtual QuicPacketWriter* CreateQuicPacketWriter(); | 213 virtual QuicPacketWriter* CreateQuicPacketWriter(); |
| 208 | 214 |
| 209 virtual int ReadPacket(char* buffer, | 215 virtual int ReadPacket(char* buffer, |
| 210 int buffer_len, | 216 int buffer_len, |
| 211 IPEndPoint* server_address, | 217 IPEndPoint* server_address, |
| 212 IPAddressNumber* client_ip); | 218 IPAddressNumber* client_ip); |
| 213 | 219 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 297 |
| 292 // If true, store the latest response code, headers, and body. | 298 // If true, store the latest response code, headers, and body. |
| 293 bool store_response_; | 299 bool store_response_; |
| 294 // HTTP response code from most recent response. | 300 // HTTP response code from most recent response. |
| 295 size_t latest_response_code_; | 301 size_t latest_response_code_; |
| 296 // HTTP headers from most recent response. | 302 // HTTP headers from most recent response. |
| 297 std::string latest_response_headers_; | 303 std::string latest_response_headers_; |
| 298 // Body of most recent response. | 304 // Body of most recent response. |
| 299 std::string latest_response_body_; | 305 std::string latest_response_body_; |
| 300 | 306 |
| 307 // The initial value of maximum packet size of the connection. If set to |
| 308 // zero, the default is used. |
| 309 QuicByteCount initial_max_packet_length_; |
| 310 |
| 301 DISALLOW_COPY_AND_ASSIGN(QuicClient); | 311 DISALLOW_COPY_AND_ASSIGN(QuicClient); |
| 302 }; | 312 }; |
| 303 | 313 |
| 304 } // namespace tools | 314 } // namespace tools |
| 305 } // namespace net | 315 } // namespace net |
| 306 | 316 |
| 307 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 317 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
| OLD | NEW |