| 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // "Connect" to the QUIC server, including performing synchronous crypto | 37 // "Connect" to the QUIC server, including performing synchronous crypto |
| 38 // handshake. | 38 // handshake. |
| 39 bool Connect(); | 39 bool Connect(); |
| 40 | 40 |
| 41 // Start the crypto handshake. This can be done in place of the synchronous | 41 // Start the crypto handshake. This can be done in place of the synchronous |
| 42 // Connect(), but callers are responsible for making sure the crypto handshake | 42 // Connect(), but callers are responsible for making sure the crypto handshake |
| 43 // completes. | 43 // completes. |
| 44 bool StartConnect(); | 44 bool StartConnect(); |
| 45 | 45 |
| 46 // Returns true if the crypto handshake is in progress. | 46 // Returns true if the crypto handshake has yet to establish encryption. |
| 47 // Returns false if the handshake is complete or the connection has been | 47 // Returns false if encryption is active (even if the server hasn't confirmed |
| 48 // closed. | 48 // the handshake) or if the connection has been closed. |
| 49 bool CryptoHandshakeInProgress(); | 49 bool EncryptionBeingEstablished(); |
| 50 | 50 |
| 51 // Disconnects from the QUIC server. | 51 // Disconnects from the QUIC server. |
| 52 void Disconnect(); | 52 void Disconnect(); |
| 53 | 53 |
| 54 // Sends a request simple GET for each URL in arg, and then waits for | 54 // Sends a request simple GET for each URL in arg, and then waits for |
| 55 // each to complete. | 55 // each to complete. |
| 56 void SendRequestsAndWaitForResponse(int argc, char *argv[]); | 56 void SendRequestsAndWaitForResponse(int argc, char *argv[]); |
| 57 | 57 |
| 58 // Returns a newly created CreateReliableClientStream, owned by the | 58 // Returns a newly created CreateReliableClientStream, owned by the |
| 59 // QuicClient. | 59 // QuicClient. |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 QuicConfig config_; | 148 QuicConfig config_; |
| 149 QuicCryptoClientConfig crypto_config_; | 149 QuicCryptoClientConfig crypto_config_; |
| 150 | 150 |
| 151 DISALLOW_COPY_AND_ASSIGN(QuicClient); | 151 DISALLOW_COPY_AND_ASSIGN(QuicClient); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace tools | 154 } // namespace tools |
| 155 } // namespace net | 155 } // namespace net |
| 156 | 156 |
| 157 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 157 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
| OLD | NEW |