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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ResponseListener() {} | 43 ResponseListener() {} |
44 virtual ~ResponseListener() {} | 44 virtual ~ResponseListener() {} |
45 virtual void OnCompleteResponse(QuicStreamId id, | 45 virtual void OnCompleteResponse(QuicStreamId id, |
46 const BalsaHeaders& response_headers, | 46 const BalsaHeaders& response_headers, |
47 const string& response_body) = 0; | 47 const string& response_body) = 0; |
48 }; | 48 }; |
49 | 49 |
50 QuicClient(IPEndPoint server_address, | 50 QuicClient(IPEndPoint server_address, |
51 const QuicServerId& server_id, | 51 const QuicServerId& server_id, |
52 const QuicVersionVector& supported_versions, | 52 const QuicVersionVector& supported_versions, |
| 53 bool print_response); |
| 54 QuicClient(IPEndPoint server_address, |
| 55 const QuicServerId& server_id, |
| 56 const QuicVersionVector& supported_versions, |
53 bool print_response, | 57 bool print_response, |
54 uint32 initial_flow_control_window); | 58 const QuicConfig& config); |
55 QuicClient(IPEndPoint server_address, | |
56 const QuicServerId& server_id, | |
57 const QuicConfig& config, | |
58 const QuicVersionVector& supported_versions, | |
59 uint32 initial_flow_control_window); | |
60 | 59 |
61 virtual ~QuicClient(); | 60 virtual ~QuicClient(); |
62 | 61 |
63 // Initializes the client to create a connection. Should be called exactly | 62 // Initializes the client to create a connection. Should be called exactly |
64 // once before calling StartConnect or Connect. Returns true if the | 63 // once before calling StartConnect or Connect. Returns true if the |
65 // initialization succeeds, false otherwise. | 64 // initialization succeeds, false otherwise. |
66 bool Initialize(); | 65 bool Initialize(); |
67 | 66 |
68 // "Connect" to the QUIC server, including performing synchronous crypto | 67 // "Connect" to the QUIC server, including performing synchronous crypto |
69 // handshake. | 68 // handshake. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // This should be ordered such that the highest supported version is the first | 237 // This should be ordered such that the highest supported version is the first |
239 // element, with subsequent elements in descending order (versions can be | 238 // element, with subsequent elements in descending order (versions can be |
240 // skipped as necessary). We will always pick supported_versions_[0] as the | 239 // skipped as necessary). We will always pick supported_versions_[0] as the |
241 // initial version to use. | 240 // initial version to use. |
242 QuicVersionVector supported_versions_; | 241 QuicVersionVector supported_versions_; |
243 | 242 |
244 // If true, then the contents of each response will be printed to stdout | 243 // If true, then the contents of each response will be printed to stdout |
245 // when the stream is closed (in OnClose). | 244 // when the stream is closed (in OnClose). |
246 bool print_response_; | 245 bool print_response_; |
247 | 246 |
248 // Size of initial flow control receive window to advertise to server. | |
249 uint32 initial_flow_control_window_; | |
250 | |
251 DISALLOW_COPY_AND_ASSIGN(QuicClient); | 247 DISALLOW_COPY_AND_ASSIGN(QuicClient); |
252 }; | 248 }; |
253 | 249 |
254 } // namespace tools | 250 } // namespace tools |
255 } // namespace net | 251 } // namespace net |
256 | 252 |
257 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 253 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
OLD | NEW |