OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_SIMPLE_CLIENT_H_ | 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_SIMPLE_CLIENT_H_ |
6 #define NET_TOOLS_QUIC_TEST_TOOLS_SIMPLE_CLIENT_H_ | 6 #define NET_TOOLS_QUIC_TEST_TOOLS_SIMPLE_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // functions, but can be done explicitly as well. | 79 // functions, but can be done explicitly as well. |
80 virtual void Connect() = 0; | 80 virtual void Connect() = 0; |
81 | 81 |
82 // Bind to the specified address. If set_bind_to_address() is called, this | 82 // Bind to the specified address. If set_bind_to_address() is called, this |
83 // is called automatically on connect, but can be done explicitly to make | 83 // is called automatically on connect, but can be done explicitly to make |
84 // LocalIPEndPoint() meaningful before actually connecting. | 84 // LocalIPEndPoint() meaningful before actually connecting. |
85 // Sets *local_address to the actual address bound to, which can be different | 85 // Sets *local_address to the actual address bound to, which can be different |
86 // if the given address has port 0. | 86 // if the given address has port 0. |
87 virtual void Bind(IPEndPoint* local_address) = 0; | 87 virtual void Bind(IPEndPoint* local_address) = 0; |
88 | 88 |
| 89 virtual void MigrateSocket(const IPAddressNumber& new_host) = 0; |
| 90 |
89 // Returns the local socket address of the client fd. Call only when | 91 // Returns the local socket address of the client fd. Call only when |
90 // connected. | 92 // connected. |
91 // To get the local IPAdress, use local_address().host(). | 93 // To get the local IPAdress, use local_address().host(). |
92 // To get the local port, use local_address.port(). | 94 // To get the local port, use local_address.port(). |
93 virtual IPEndPoint local_address() const = 0; | 95 virtual IPEndPoint local_address() const = 0; |
94 | 96 |
95 // Returns the serialized message that would be sent by any of the HTTPMessage | 97 // Returns the serialized message that would be sent by any of the HTTPMessage |
96 // functions above. | 98 // functions above. |
97 virtual std::string SerializeMessage(const HTTPMessage& message) = 0; | 99 virtual std::string SerializeMessage(const HTTPMessage& message) = 0; |
98 | 100 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // Instructs the client to populate response_body(). | 152 // Instructs the client to populate response_body(). |
151 virtual bool buffer_body() const = 0; | 153 virtual bool buffer_body() const = 0; |
152 virtual void set_buffer_body(bool buffer_body) = 0; | 154 virtual void set_buffer_body(bool buffer_body) = 0; |
153 }; | 155 }; |
154 | 156 |
155 } // namespace test | 157 } // namespace test |
156 } // namespace tools | 158 } // namespace tools |
157 } // namespace net | 159 } // namespace net |
158 | 160 |
159 #endif // NET_TOOLS_QUIC_TEST_TOOLS_SIMPLE_CLIENT_H_ | 161 #endif // NET_TOOLS_QUIC_TEST_TOOLS_SIMPLE_CLIENT_H_ |
OLD | NEW |