| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // Returns true if the crypto handshake has yet to establish encryption. | 77 // Returns true if the crypto handshake has yet to establish encryption. |
| 78 // Returns false if encryption is active (even if the server hasn't confirmed | 78 // Returns false if encryption is active (even if the server hasn't confirmed |
| 79 // the handshake) or if the connection has been closed. | 79 // the handshake) or if the connection has been closed. |
| 80 bool EncryptionBeingEstablished(); | 80 bool EncryptionBeingEstablished(); |
| 81 | 81 |
| 82 // Disconnects from the QUIC server. | 82 // Disconnects from the QUIC server. |
| 83 void Disconnect(); | 83 void Disconnect(); |
| 84 | 84 |
| 85 // Sends a request simple GET for each URL in |args|, and then waits for | 85 // Sends a request simple GET for each URL in |args|, and then waits for |
| 86 // each to complete. | 86 // each to complete. |
| 87 void SendRequestsAndWaitForResponse(const | 87 void SendRequestsAndWaitForResponse( |
| 88 base::CommandLine::StringVector& args); | 88 const base::CommandLine::StringVector& args); |
| 89 | 89 |
| 90 // Returns a newly created QuicSpdyClientStream, owned by the | 90 // Returns a newly created QuicSpdyClientStream, owned by the |
| 91 // QuicClient. | 91 // QuicClient. |
| 92 QuicSpdyClientStream* CreateReliableClientStream(); | 92 QuicSpdyClientStream* CreateReliableClientStream(); |
| 93 | 93 |
| 94 // Wait for events until the stream with the given ID is closed. | 94 // Wait for events until the stream with the given ID is closed. |
| 95 void WaitForStreamToClose(QuicStreamId id); | 95 void WaitForStreamToClose(QuicStreamId id); |
| 96 | 96 |
| 97 // Wait for events until the handshake is confirmed. | 97 // Wait for events until the handshake is confirmed. |
| 98 void WaitForCryptoHandshakeConfirmed(); | 98 void WaitForCryptoHandshakeConfirmed(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 const IPEndPoint& client_address() const { return client_address_; } | 135 const IPEndPoint& client_address() const { return client_address_; } |
| 136 | 136 |
| 137 EpollServer* epoll_server() { return &epoll_server_; } | 137 EpollServer* epoll_server() { return &epoll_server_; } |
| 138 | 138 |
| 139 int fd() { return fd_; } | 139 int fd() { return fd_; } |
| 140 | 140 |
| 141 const QuicServerId& server_id() const { return server_id_; } | 141 const QuicServerId& server_id() const { return server_id_; } |
| 142 | 142 |
| 143 // This should only be set before the initial Connect() | 143 // This should only be set before the initial Connect() |
| 144 void set_server_id(const QuicServerId& server_id) { | 144 void set_server_id(const QuicServerId& server_id) { server_id_ = server_id; } |
| 145 server_id_ = server_id; | |
| 146 } | |
| 147 | 145 |
| 148 // SetProofVerifier sets the ProofVerifier that will be used to verify the | 146 // SetProofVerifier sets the ProofVerifier that will be used to verify the |
| 149 // server's certificate and takes ownership of |verifier|. | 147 // server's certificate and takes ownership of |verifier|. |
| 150 void SetProofVerifier(ProofVerifier* verifier) { | 148 void SetProofVerifier(ProofVerifier* verifier) { |
| 151 // TODO(rtenneti): We should set ProofVerifier in QuicClientSession. | 149 // TODO(rtenneti): We should set ProofVerifier in QuicClientSession. |
| 152 crypto_config_.SetProofVerifier(verifier); | 150 crypto_config_.SetProofVerifier(verifier); |
| 153 } | 151 } |
| 154 | 152 |
| 155 // SetChannelIDSigner sets a ChannelIDSigner that will be called when the | 153 // SetChannelIDSigner sets a ChannelIDSigner that will be called when the |
| 156 // server supports channel IDs to sign a message proving possession of the | 154 // server supports channel IDs to sign a message proving possession of the |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // Size of initial flow control receive window to advertise to server. | 243 // Size of initial flow control receive window to advertise to server. |
| 246 uint32 initial_flow_control_window_; | 244 uint32 initial_flow_control_window_; |
| 247 | 245 |
| 248 DISALLOW_COPY_AND_ASSIGN(QuicClient); | 246 DISALLOW_COPY_AND_ASSIGN(QuicClient); |
| 249 }; | 247 }; |
| 250 | 248 |
| 251 } // namespace tools | 249 } // namespace tools |
| 252 } // namespace net | 250 } // namespace net |
| 253 | 251 |
| 254 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ | 252 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_H_ |
| OLD | NEW |