| 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 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/hash_tables.h" | 13 #include "base/hash_tables.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "net/base/ip_endpoint.h" | 15 #include "net/base/ip_endpoint.h" |
| 16 #include "net/quic/crypto/crypto_handshake.h" |
| 17 #include "net/quic/quic_config.h" |
| 16 #include "net/quic/quic_framer.h" | 18 #include "net/quic/quic_framer.h" |
| 17 #include "net/quic/quic_packet_creator.h" | 19 #include "net/quic/quic_packet_creator.h" |
| 18 #include "net/tools/flip_server/epoll_server.h" | 20 #include "net/tools/flip_server/epoll_server.h" |
| 19 #include "net/tools/quic/quic_client_session.h" | 21 #include "net/tools/quic/quic_client_session.h" |
| 20 #include "net/tools/quic/quic_reliable_client_stream.h" | 22 #include "net/tools/quic/quic_reliable_client_stream.h" |
| 21 | 23 |
| 22 namespace net { | 24 namespace net { |
| 23 namespace tools { | 25 namespace tools { |
| 24 | 26 |
| 25 class QuicClient : public EpollCallbackInterface { | 27 class QuicClient : public EpollCallbackInterface { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 136 |
| 135 // If overflow_supported_ is true, this will be the number of packets dropped | 137 // If overflow_supported_ is true, this will be the number of packets dropped |
| 136 // during the lifetime of the server. This may overflow if enough packets | 138 // during the lifetime of the server. This may overflow if enough packets |
| 137 // are dropped. | 139 // are dropped. |
| 138 int packets_dropped_; | 140 int packets_dropped_; |
| 139 | 141 |
| 140 // True if the kernel supports SO_RXQ_OVFL, the number of packets dropped | 142 // True if the kernel supports SO_RXQ_OVFL, the number of packets dropped |
| 141 // because the socket would otherwise overflow. | 143 // because the socket would otherwise overflow. |
| 142 bool overflow_supported_; | 144 bool overflow_supported_; |
| 143 | 145 |
| 146 // config_ and crypto_config_ contain configuration and cached state about |
| 147 // servers. |
| 148 QuicConfig config_; |
| 149 QuicCryptoClientConfig crypto_config_; |
| 150 |
| 144 DISALLOW_COPY_AND_ASSIGN(QuicClient); | 151 DISALLOW_COPY_AND_ASSIGN(QuicClient); |
| 145 }; | 152 }; |
| 146 | 153 |
| 147 } // namespace tools | 154 } // namespace tools |
| 148 } // namespace net | 155 } // namespace net |
| 149 | 156 |
| 150 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 157 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
| OLD | NEW |