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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 QuicCryptoClientConfig crypto_config_; | 207 QuicCryptoClientConfig crypto_config_; |
208 | 208 |
209 // Address of the client if the client is connected to the server. | 209 // Address of the client if the client is connected to the server. |
210 IPEndPoint client_address_; | 210 IPEndPoint client_address_; |
211 | 211 |
212 // If initialized, the address to bind to. | 212 // If initialized, the address to bind to. |
213 IPAddressNumber bind_to_address_; | 213 IPAddressNumber bind_to_address_; |
214 // Local port to bind to. Initialize to 0. | 214 // Local port to bind to. Initialize to 0. |
215 int local_port_; | 215 int local_port_; |
216 | 216 |
| 217 // Writer used to actually send packets to the wire. Needs to outlive |
| 218 // |session_|. |
| 219 scoped_ptr<QuicPacketWriter> writer_; |
| 220 |
217 // Session which manages streams. | 221 // Session which manages streams. |
218 scoped_ptr<QuicClientSession> session_; | 222 scoped_ptr<QuicClientSession> session_; |
219 // Listens for events on the client socket. | 223 // Listens for events on the client socket. |
220 EpollServer* epoll_server_; | 224 EpollServer* epoll_server_; |
221 // UDP socket. | 225 // UDP socket. |
222 int fd_; | 226 int fd_; |
223 | 227 |
224 // Helper to be used by created connections. | 228 // Helper to be used by created connections. |
225 scoped_ptr<QuicEpollConnectionHelper> helper_; | 229 scoped_ptr<QuicEpollConnectionHelper> helper_; |
226 | 230 |
227 // Listens for full responses. | 231 // Listens for full responses. |
228 scoped_ptr<ResponseListener> response_listener_; | 232 scoped_ptr<ResponseListener> response_listener_; |
229 | 233 |
230 // Writer used to actually send packets to the wire. | |
231 scoped_ptr<QuicPacketWriter> writer_; | |
232 | |
233 // Tracks if the client is initialized to connect. | 234 // Tracks if the client is initialized to connect. |
234 bool initialized_; | 235 bool initialized_; |
235 | 236 |
236 // If overflow_supported_ is true, this will be the number of packets dropped | 237 // If overflow_supported_ is true, this will be the number of packets dropped |
237 // during the lifetime of the server. This may overflow if enough packets | 238 // during the lifetime of the server. This may overflow if enough packets |
238 // are dropped. | 239 // are dropped. |
239 uint32 packets_dropped_; | 240 uint32 packets_dropped_; |
240 | 241 |
241 // True if the kernel supports SO_RXQ_OVFL, the number of packets dropped | 242 // True if the kernel supports SO_RXQ_OVFL, the number of packets dropped |
242 // because the socket would otherwise overflow. | 243 // because the socket would otherwise overflow. |
(...skipping 10 matching lines...) Expand all Loading... |
253 // when the stream is closed (in OnClose). | 254 // when the stream is closed (in OnClose). |
254 bool print_response_; | 255 bool print_response_; |
255 | 256 |
256 DISALLOW_COPY_AND_ASSIGN(QuicClient); | 257 DISALLOW_COPY_AND_ASSIGN(QuicClient); |
257 }; | 258 }; |
258 | 259 |
259 } // namespace tools | 260 } // namespace tools |
260 } // namespace net | 261 } // namespace net |
261 | 262 |
262 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 263 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
OLD | NEW |