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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 DCHECK(!session_.get()); | 161 DCHECK(!session_.get()); |
162 supported_versions_ = versions; | 162 supported_versions_ = versions; |
163 } | 163 } |
164 | 164 |
165 // Takes ownership of the listener. | 165 // Takes ownership of the listener. |
166 void set_response_listener(ResponseListener* listener) { | 166 void set_response_listener(ResponseListener* listener) { |
167 response_listener_.reset(listener); | 167 response_listener_.reset(listener); |
168 } | 168 } |
169 | 169 |
170 protected: | 170 protected: |
171 virtual QuicGuid GenerateGuid(); | 171 virtual QuicConnectionId GenerateConnectionId(); |
172 virtual QuicEpollConnectionHelper* CreateQuicConnectionHelper(); | 172 virtual QuicEpollConnectionHelper* CreateQuicConnectionHelper(); |
173 virtual QuicPacketWriter* CreateQuicPacketWriter(); | 173 virtual QuicPacketWriter* CreateQuicPacketWriter(); |
174 | 174 |
175 private: | 175 private: |
176 friend class net::tools::test::QuicClientPeer; | 176 friend class net::tools::test::QuicClientPeer; |
177 | 177 |
178 // Read a UDP packet and hand it to the framer. | 178 // Read a UDP packet and hand it to the framer. |
179 bool ReadAndProcessPacket(); | 179 bool ReadAndProcessPacket(); |
180 | 180 |
181 // Address of the server. | 181 // Address of the server. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // when the stream is closed (in OnClose). | 236 // when the stream is closed (in OnClose). |
237 bool print_response_; | 237 bool print_response_; |
238 | 238 |
239 DISALLOW_COPY_AND_ASSIGN(QuicClient); | 239 DISALLOW_COPY_AND_ASSIGN(QuicClient); |
240 }; | 240 }; |
241 | 241 |
242 } // namespace tools | 242 } // namespace tools |
243 } // namespace net | 243 } // namespace net |
244 | 244 |
245 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 245 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
OLD | NEW |