connection_attempts.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2015 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_SOCKET_CONNECTION_ATTEMPTS_H_
  5. #define NET_SOCKET_CONNECTION_ATTEMPTS_H_
  6. #include "net/base/ip_endpoint.h"
  7. namespace net {
  8. // A record of an connection attempt made to connect to a host. Includes TCP
  9. // and SSL errors, but not proxy connections.
  10. struct ConnectionAttempt {
  11. ConnectionAttempt(const IPEndPoint endpoint, int result)
  12. : endpoint(endpoint), result(result) {}
  13. bool operator==(const ConnectionAttempt& other) const {
  14. return endpoint == other.endpoint && result == other.result;
  15. }
  16. // Address and port the socket layer attempted to connect to.
  17. IPEndPoint endpoint;
  18. // Net error indicating the result of that attempt.
  19. int result;
  20. };
  21. // Multiple connection attempts, as might be tracked in an HttpTransaction or a
  22. // URLRequest. Order is insignificant.
  23. typedef std::vector<ConnectionAttempt> ConnectionAttempts;
  24. } // namespace net
  25. #endif // NET_SOCKET_CONNECTION_ATTEMPTS_H_