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 16 matching lines...) Expand all Loading... |
27 class ProofVerifier; | 27 class ProofVerifier; |
28 | 28 |
29 namespace tools { | 29 namespace tools { |
30 | 30 |
31 namespace test { | 31 namespace test { |
32 class QuicClientPeer; | 32 class QuicClientPeer; |
33 } // namespace test | 33 } // namespace test |
34 | 34 |
35 class QuicClient : public EpollCallbackInterface { | 35 class QuicClient : public EpollCallbackInterface { |
36 public: | 36 public: |
37 QuicClient(IPEndPoint server_address, const std::string& server_hostname); | 37 QuicClient(IPEndPoint server_address, const std::string& server_hostname, |
| 38 const QuicVersion version); |
38 QuicClient(IPEndPoint server_address, | 39 QuicClient(IPEndPoint server_address, |
39 const std::string& server_hostname, | 40 const std::string& server_hostname, |
40 const QuicConfig& config); | 41 const QuicConfig& config, |
| 42 const QuicVersion version); |
41 | 43 |
42 virtual ~QuicClient(); | 44 virtual ~QuicClient(); |
43 | 45 |
44 // Initializes the client to create a connection. Should be called exactly | 46 // Initializes the client to create a connection. Should be called exactly |
45 // once before calling StartConnect or Connect. Returns true if the | 47 // once before calling StartConnect or Connect. Returns true if the |
46 // initialization succeeds, false otherwise. | 48 // initialization succeeds, false otherwise. |
47 bool Initialize(); | 49 bool Initialize(); |
48 | 50 |
49 // "Connect" to the QUIC server, including performing synchronous crypto | 51 // "Connect" to the QUIC server, including performing synchronous crypto |
50 // handshake. | 52 // handshake. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 172 |
171 // If overflow_supported_ is true, this will be the number of packets dropped | 173 // If overflow_supported_ is true, this will be the number of packets dropped |
172 // during the lifetime of the server. This may overflow if enough packets | 174 // during the lifetime of the server. This may overflow if enough packets |
173 // are dropped. | 175 // are dropped. |
174 int packets_dropped_; | 176 int packets_dropped_; |
175 | 177 |
176 // True if the kernel supports SO_RXQ_OVFL, the number of packets dropped | 178 // True if the kernel supports SO_RXQ_OVFL, the number of packets dropped |
177 // because the socket would otherwise overflow. | 179 // because the socket would otherwise overflow. |
178 bool overflow_supported_; | 180 bool overflow_supported_; |
179 | 181 |
| 182 // Which QUIC version does this client talk? |
| 183 QuicVersion version_; |
| 184 |
180 DISALLOW_COPY_AND_ASSIGN(QuicClient); | 185 DISALLOW_COPY_AND_ASSIGN(QuicClient); |
181 }; | 186 }; |
182 | 187 |
183 } // namespace tools | 188 } // namespace tools |
184 } // namespace net | 189 } // namespace net |
185 | 190 |
186 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 191 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
OLD | NEW |