Deprecate QuicClient in favor of QuicDefaultClient.

Since we cannot currently remove QuicClient (as it is used in the production GFE code, and would require flag protection), this CL renames it into QuicEpollClient and moves it into a separate, unexported directory.

PiperOrigin-RevId: 474129362
diff --git a/build/source_list.bzl b/build/source_list.bzl
index 6a35a8e..65e4d16 100644
--- a/build/source_list.bzl
+++ b/build/source_list.bzl
@@ -986,8 +986,6 @@
     "quic/masque/masque_utils.h",
     "quic/platform/api/quic_epoll.h",
     "quic/platform/api/quic_udp_socket_platform_api.h",
-    "quic/tools/quic_client.h",
-    "quic/tools/quic_client_epoll_network_helper.h",
     "quic/tools/quic_server.h",
 ]
 epoll_tool_support_srcs = [
@@ -1019,8 +1017,6 @@
     "quic/masque/masque_server_backend.cc",
     "quic/masque/masque_server_session.cc",
     "quic/masque/masque_utils.cc",
-    "quic/tools/quic_client.cc",
-    "quic/tools/quic_client_epoll_network_helper.cc",
     "quic/tools/quic_server.cc",
 ]
 epoll_test_support_hdrs = [
@@ -1327,7 +1323,6 @@
     "quic/core/quic_epoll_clock_test.cc",
     "quic/core/quic_epoll_connection_helper_test.cc",
     "quic/core/quic_linux_socket_utils_test.cc",
-    "quic/tools/quic_client_test.cc",
     "quic/tools/quic_server_test.cc",
     "quic/tools/quic_simple_server_session_test.cc",
     "quic/tools/quic_simple_server_stream_test.cc",
diff --git a/build/source_list.gni b/build/source_list.gni
index 8d629f6..720a9a9 100644
--- a/build/source_list.gni
+++ b/build/source_list.gni
@@ -986,8 +986,6 @@
     "src/quiche/quic/masque/masque_utils.h",
     "src/quiche/quic/platform/api/quic_epoll.h",
     "src/quiche/quic/platform/api/quic_udp_socket_platform_api.h",
-    "src/quiche/quic/tools/quic_client.h",
-    "src/quiche/quic/tools/quic_client_epoll_network_helper.h",
     "src/quiche/quic/tools/quic_server.h",
 ]
 epoll_tool_support_srcs = [
@@ -1019,8 +1017,6 @@
     "src/quiche/quic/masque/masque_server_backend.cc",
     "src/quiche/quic/masque/masque_server_session.cc",
     "src/quiche/quic/masque/masque_utils.cc",
-    "src/quiche/quic/tools/quic_client.cc",
-    "src/quiche/quic/tools/quic_client_epoll_network_helper.cc",
     "src/quiche/quic/tools/quic_server.cc",
 ]
 epoll_test_support_hdrs = [
@@ -1327,7 +1323,6 @@
     "src/quiche/quic/core/quic_epoll_clock_test.cc",
     "src/quiche/quic/core/quic_epoll_connection_helper_test.cc",
     "src/quiche/quic/core/quic_linux_socket_utils_test.cc",
-    "src/quiche/quic/tools/quic_client_test.cc",
     "src/quiche/quic/tools/quic_server_test.cc",
     "src/quiche/quic/tools/quic_simple_server_session_test.cc",
     "src/quiche/quic/tools/quic_simple_server_stream_test.cc",
diff --git a/build/source_list.json b/build/source_list.json
index e0c9ba9..f39abd1 100644
--- a/build/source_list.json
+++ b/build/source_list.json
@@ -985,8 +985,6 @@
     "quiche/quic/masque/masque_utils.h",
     "quiche/quic/platform/api/quic_epoll.h",
     "quiche/quic/platform/api/quic_udp_socket_platform_api.h",
-    "quiche/quic/tools/quic_client.h",
-    "quiche/quic/tools/quic_client_epoll_network_helper.h",
     "quiche/quic/tools/quic_server.h"
   ],
   "epoll_tool_support_srcs": [
@@ -1018,8 +1016,6 @@
     "quiche/quic/masque/masque_server_backend.cc",
     "quiche/quic/masque/masque_server_session.cc",
     "quiche/quic/masque/masque_utils.cc",
-    "quiche/quic/tools/quic_client.cc",
-    "quiche/quic/tools/quic_client_epoll_network_helper.cc",
     "quiche/quic/tools/quic_server.cc"
   ],
   "epoll_test_support_hdrs": [
@@ -1326,7 +1322,6 @@
     "quiche/quic/core/quic_epoll_clock_test.cc",
     "quiche/quic/core/quic_epoll_connection_helper_test.cc",
     "quiche/quic/core/quic_linux_socket_utils_test.cc",
-    "quiche/quic/tools/quic_client_test.cc",
     "quiche/quic/tools/quic_server_test.cc",
     "quiche/quic/tools/quic_simple_server_session_test.cc",
     "quiche/quic/tools/quic_simple_server_stream_test.cc",
diff --git a/quiche/quic/tools/quic_client.cc b/quiche/quic/tools/quic_client.cc
deleted file mode 100644
index fca34d2..0000000
--- a/quiche/quic/tools/quic_client.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "quiche/quic/tools/quic_client.h"
-
-#include <utility>
-
-#include "quiche/quic/core/crypto/quic_random.h"
-#include "quiche/quic/core/http/spdy_utils.h"
-#include "quiche/quic/core/quic_connection.h"
-#include "quiche/quic/core/quic_data_reader.h"
-#include "quiche/quic/core/quic_epoll_alarm_factory.h"
-#include "quiche/quic/core/quic_epoll_connection_helper.h"
-#include "quiche/quic/core/quic_packets.h"
-#include "quiche/quic/core/quic_server_id.h"
-#include "quiche/quic/platform/api/quic_bug_tracker.h"
-#include "quiche/quic/platform/api/quic_logging.h"
-#include "quiche/quic/platform/api/quic_socket_address.h"
-#include "quiche/quic/tools/quic_simple_client_session.h"
-
-namespace quic {
-
-QuicClient::QuicClient(QuicSocketAddress server_address,
-                       const QuicServerId& server_id,
-                       const ParsedQuicVersionVector& supported_versions,
-                       QuicEpollServer* epoll_server,
-                       std::unique_ptr<ProofVerifier> proof_verifier)
-    : QuicClient(
-          server_address, server_id, supported_versions, QuicConfig(),
-          epoll_server,
-          std::make_unique<QuicClientEpollNetworkHelper>(epoll_server, this),
-          std::move(proof_verifier), nullptr) {}
-
-QuicClient::QuicClient(QuicSocketAddress server_address,
-                       const QuicServerId& server_id,
-                       const ParsedQuicVersionVector& supported_versions,
-                       QuicEpollServer* epoll_server,
-                       std::unique_ptr<ProofVerifier> proof_verifier,
-                       std::unique_ptr<SessionCache> session_cache)
-    : QuicClient(
-          server_address, server_id, supported_versions, QuicConfig(),
-          epoll_server,
-          std::make_unique<QuicClientEpollNetworkHelper>(epoll_server, this),
-          std::move(proof_verifier), std::move(session_cache)) {}
-
-QuicClient::QuicClient(QuicSocketAddress server_address,
-                       const QuicServerId& server_id,
-                       const ParsedQuicVersionVector& supported_versions,
-                       const QuicConfig& config, QuicEpollServer* epoll_server,
-                       std::unique_ptr<ProofVerifier> proof_verifier,
-                       std::unique_ptr<SessionCache> session_cache)
-    : QuicClient(
-          server_address, server_id, supported_versions, config, epoll_server,
-          std::make_unique<QuicClientEpollNetworkHelper>(epoll_server, this),
-          std::move(proof_verifier), std::move(session_cache)) {}
-
-QuicClient::QuicClient(
-    QuicSocketAddress server_address, const QuicServerId& server_id,
-    const ParsedQuicVersionVector& supported_versions,
-    QuicEpollServer* epoll_server,
-    std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
-    std::unique_ptr<ProofVerifier> proof_verifier)
-    : QuicClient(server_address, server_id, supported_versions, QuicConfig(),
-                 epoll_server, std::move(network_helper),
-                 std::move(proof_verifier), nullptr) {}
-
-QuicClient::QuicClient(
-    QuicSocketAddress server_address, const QuicServerId& server_id,
-    const ParsedQuicVersionVector& supported_versions, const QuicConfig& config,
-    QuicEpollServer* epoll_server,
-    std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
-    std::unique_ptr<ProofVerifier> proof_verifier)
-    : QuicClient(server_address, server_id, supported_versions, config,
-                 epoll_server, std::move(network_helper),
-                 std::move(proof_verifier), nullptr) {}
-
-QuicClient::QuicClient(
-    QuicSocketAddress server_address, const QuicServerId& server_id,
-    const ParsedQuicVersionVector& supported_versions, const QuicConfig& config,
-    QuicEpollServer* epoll_server,
-    std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
-    std::unique_ptr<ProofVerifier> proof_verifier,
-    std::unique_ptr<SessionCache> session_cache)
-    : QuicSpdyClientBase(
-          server_id, supported_versions, config,
-          new QuicEpollConnectionHelper(epoll_server, QuicAllocator::SIMPLE),
-          new QuicEpollAlarmFactory(epoll_server), std::move(network_helper),
-          std::move(proof_verifier), std::move(session_cache)) {
-  set_server_address(server_address);
-}
-
-QuicClient::~QuicClient() = default;
-
-std::unique_ptr<QuicSession> QuicClient::CreateQuicClientSession(
-    const ParsedQuicVersionVector& supported_versions,
-    QuicConnection* connection) {
-  return std::make_unique<QuicSimpleClientSession>(
-      *config(), supported_versions, connection, network_helper(), server_id(),
-      crypto_config(), push_promise_index(), drop_response_body(),
-      enable_web_transport());
-}
-
-QuicClientEpollNetworkHelper* QuicClient::epoll_network_helper() {
-  return static_cast<QuicClientEpollNetworkHelper*>(network_helper());
-}
-
-const QuicClientEpollNetworkHelper* QuicClient::epoll_network_helper() const {
-  return static_cast<const QuicClientEpollNetworkHelper*>(network_helper());
-}
-
-}  // namespace quic
diff --git a/quiche/quic/tools/quic_client.h b/quiche/quic/tools/quic_client.h
deleted file mode 100644
index fc7c62f..0000000
--- a/quiche/quic/tools/quic_client.h
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// A toy client, which connects to a specified port and sends QUIC
-// request to that endpoint.
-
-#ifndef QUICHE_QUIC_TOOLS_QUIC_CLIENT_H_
-#define QUICHE_QUIC_TOOLS_QUIC_CLIENT_H_
-
-#include <cstdint>
-#include <memory>
-#include <string>
-
-#include "quiche/quic/core/http/quic_client_push_promise_index.h"
-#include "quiche/quic/core/http/quic_spdy_client_session.h"
-#include "quiche/quic/core/quic_config.h"
-#include "quiche/quic/core/quic_packet_reader.h"
-#include "quiche/quic/platform/api/quic_epoll.h"
-#include "quiche/quic/tools/quic_client_epoll_network_helper.h"
-#include "quiche/quic/tools/quic_name_lookup.h"
-#include "quiche/quic/tools/quic_spdy_client_base.h"
-
-namespace quic {
-
-class QuicServerId;
-
-namespace test {
-class QuicClientPeer;
-}  // namespace test
-
-class QuicClient : public QuicSpdyClientBase {
- public:
-  // These will create their own QuicClientEpollNetworkHelper.
-  QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
-             const ParsedQuicVersionVector& supported_versions,
-             QuicEpollServer* epoll_server,
-             std::unique_ptr<ProofVerifier> proof_verifier);
-  QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
-             const ParsedQuicVersionVector& supported_versions,
-             QuicEpollServer* epoll_server,
-             std::unique_ptr<ProofVerifier> proof_verifier,
-             std::unique_ptr<SessionCache> session_cache);
-  QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
-             const ParsedQuicVersionVector& supported_versions,
-             const QuicConfig& config, QuicEpollServer* epoll_server,
-             std::unique_ptr<ProofVerifier> proof_verifier,
-             std::unique_ptr<SessionCache> session_cache);
-  // This will take ownership of a passed in network primitive.
-  QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
-             const ParsedQuicVersionVector& supported_versions,
-             QuicEpollServer* epoll_server,
-             std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
-             std::unique_ptr<ProofVerifier> proof_verifier);
-  QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
-             const ParsedQuicVersionVector& supported_versions,
-             const QuicConfig& config, QuicEpollServer* epoll_server,
-             std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
-             std::unique_ptr<ProofVerifier> proof_verifier);
-  QuicClient(QuicSocketAddress server_address, const QuicServerId& server_id,
-             const ParsedQuicVersionVector& supported_versions,
-             const QuicConfig& config, QuicEpollServer* epoll_server,
-             std::unique_ptr<QuicClientEpollNetworkHelper> network_helper,
-             std::unique_ptr<ProofVerifier> proof_verifier,
-             std::unique_ptr<SessionCache> session_cache);
-  QuicClient(const QuicClient&) = delete;
-  QuicClient& operator=(const QuicClient&) = delete;
-
-  ~QuicClient() override;
-
-  std::unique_ptr<QuicSession> CreateQuicClientSession(
-      const ParsedQuicVersionVector& supported_versions,
-      QuicConnection* connection) override;
-
-  // Exposed for the quic client test.
-  int GetLatestFD() const { return epoll_network_helper()->GetLatestFD(); }
-
-  QuicClientEpollNetworkHelper* epoll_network_helper();
-  const QuicClientEpollNetworkHelper* epoll_network_helper() const;
-};
-
-}  // namespace quic
-
-#endif  // QUICHE_QUIC_TOOLS_QUIC_CLIENT_H_
diff --git a/quiche/quic/tools/quic_client_epoll_network_helper.cc b/quiche/quic/tools/quic_client_epoll_network_helper.cc
deleted file mode 100644
index 60bf6c1..0000000
--- a/quiche/quic/tools/quic_client_epoll_network_helper.cc
+++ /dev/null
@@ -1,238 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "quiche/quic/tools/quic_client_epoll_network_helper.h"
-
-#include <errno.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <sys/epoll.h>
-#include <sys/socket.h>
-#include <unistd.h>
-
-#include "absl/cleanup/cleanup.h"
-#include "quiche/quic/core/crypto/quic_random.h"
-#include "quiche/quic/core/http/spdy_utils.h"
-#include "quiche/quic/core/quic_connection.h"
-#include "quiche/quic/core/quic_data_reader.h"
-#include "quiche/quic/core/quic_epoll_alarm_factory.h"
-#include "quiche/quic/core/quic_epoll_connection_helper.h"
-#include "quiche/quic/core/quic_packets.h"
-#include "quiche/quic/core/quic_server_id.h"
-#include "quiche/quic/core/quic_udp_socket.h"
-#include "quiche/quic/platform/api/quic_bug_tracker.h"
-#include "quiche/quic/platform/api/quic_logging.h"
-#include "quiche/common/platform/api/quiche_system_event_loop.h"
-
-namespace quic {
-
-namespace {
-const int kEpollFlags = EPOLLIN | EPOLLOUT | EPOLLET;
-}  // namespace
-
-QuicClientEpollNetworkHelper::QuicClientEpollNetworkHelper(
-    QuicEpollServer* epoll_server, QuicClientBase* client)
-    : epoll_server_(epoll_server),
-      packets_dropped_(0),
-      overflow_supported_(false),
-      packet_reader_(new QuicPacketReader()),
-      client_(client),
-      max_reads_per_epoll_loop_(std::numeric_limits<int>::max()) {}
-
-QuicClientEpollNetworkHelper::~QuicClientEpollNetworkHelper() {
-  if (client_->connected()) {
-    client_->session()->connection()->CloseConnection(
-        QUIC_PEER_GOING_AWAY, "Client being torn down",
-        ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
-  }
-
-  CleanUpAllUDPSockets();
-}
-
-std::string QuicClientEpollNetworkHelper::Name() const {
-  return "QuicClientEpollNetworkHelper";
-}
-
-bool QuicClientEpollNetworkHelper::CreateUDPSocketAndBind(
-    QuicSocketAddress server_address, QuicIpAddress bind_to_address,
-    int bind_to_port) {
-  epoll_server_->set_timeout_in_us(50 * 1000);
-
-  int fd = CreateUDPSocket(server_address, &overflow_supported_);
-  if (fd < 0) {
-    return false;
-  }
-  auto closer = absl::MakeCleanup([fd] { close(fd); });
-
-  QuicSocketAddress client_address;
-  if (bind_to_address.IsInitialized()) {
-    client_address = QuicSocketAddress(bind_to_address, client_->local_port());
-  } else if (server_address.host().address_family() == IpAddressFamily::IP_V4) {
-    client_address = QuicSocketAddress(QuicIpAddress::Any4(), bind_to_port);
-  } else {
-    client_address = QuicSocketAddress(QuicIpAddress::Any6(), bind_to_port);
-  }
-
-  // Some platforms expect that the addrlen given to bind() exactly matches the
-  // size of the associated protocol family's sockaddr struct.
-  // TODO(b/179430548): Revert this when affected platforms are updated to
-  // to support binding with an addrelen of sizeof(sockaddr_storage)
-  socklen_t addrlen;
-  switch (client_address.host().address_family()) {
-    case IpAddressFamily::IP_V4:
-      addrlen = sizeof(sockaddr_in);
-      break;
-    case IpAddressFamily::IP_V6:
-      addrlen = sizeof(sockaddr_in6);
-      break;
-    case IpAddressFamily::IP_UNSPEC:
-      addrlen = 0;
-      break;
-  }
-
-  sockaddr_storage addr = client_address.generic_address();
-  int rc = bind(fd, reinterpret_cast<sockaddr*>(&addr), addrlen);
-  if (rc < 0) {
-    QUIC_LOG(ERROR) << "Bind failed: " << strerror(errno)
-                    << " bind_to_address:" << bind_to_address
-                    << ", bind_to_port:" << bind_to_port
-                    << ", client_address:" << client_address;
-    return false;
-  }
-
-  if (client_address.FromSocket(fd) != 0) {
-    QUIC_LOG(ERROR) << "Unable to get self address.  Error: "
-                    << strerror(errno);
-  }
-
-  fd_address_map_[fd] = client_address;
-  epoll_server_->RegisterFD(fd, this, kEpollFlags);
-  std::move(closer).Cancel();
-  return true;
-}
-
-void QuicClientEpollNetworkHelper::CleanUpUDPSocket(int fd) {
-  CleanUpUDPSocketImpl(fd);
-  fd_address_map_.erase(fd);
-}
-
-void QuicClientEpollNetworkHelper::CleanUpAllUDPSockets() {
-  for (std::pair<int, QuicSocketAddress> fd_address : fd_address_map_) {
-    CleanUpUDPSocketImpl(fd_address.first);
-  }
-  fd_address_map_.clear();
-}
-
-void QuicClientEpollNetworkHelper::CleanUpUDPSocketImpl(int fd) {
-  if (fd > -1) {
-    epoll_server_->UnregisterFD(fd);
-    int rc = close(fd);
-    QUICHE_DCHECK_EQ(0, rc);
-  }
-}
-
-void QuicClientEpollNetworkHelper::RunEventLoop() {
-  quiche::QuicheRunSystemEventLoopIteration();
-  epoll_server_->WaitForEventsAndExecuteCallbacks();
-}
-
-void QuicClientEpollNetworkHelper::OnRegistration(QuicEpollServer* /*eps*/,
-                                                  int /*fd*/,
-                                                  int /*event_mask*/) {}
-void QuicClientEpollNetworkHelper::OnModification(int /*fd*/,
-                                                  int /*event_mask*/) {}
-void QuicClientEpollNetworkHelper::OnUnregistration(int /*fd*/,
-                                                    bool /*replaced*/) {}
-void QuicClientEpollNetworkHelper::OnShutdown(QuicEpollServer* /*eps*/,
-                                              int /*fd*/) {}
-
-void QuicClientEpollNetworkHelper::OnEvent(int fd, QuicEpollEvent* event) {
-  if (event->in_events & EPOLLIN) {
-    QUIC_DVLOG(1) << "Read packets on EPOLLIN";
-    int times_to_read = max_reads_per_epoll_loop_;
-    bool more_to_read = true;
-    QuicPacketCount packets_dropped = 0;
-    while (client_->connected() && more_to_read && times_to_read > 0) {
-      more_to_read = packet_reader_->ReadAndDispatchPackets(
-          fd, GetLatestClientAddress().port(), *client_->helper()->GetClock(),
-          this, overflow_supported_ ? &packets_dropped : nullptr);
-      --times_to_read;
-    }
-    if (packets_dropped_ < packets_dropped) {
-      QUIC_LOG(ERROR)
-          << packets_dropped - packets_dropped_
-          << " more packets are dropped in the socket receive buffer.";
-      packets_dropped_ = packets_dropped;
-    }
-    if (client_->connected() && more_to_read) {
-      event->out_ready_mask |= EPOLLIN;
-    }
-  }
-  if (client_->connected() && (event->in_events & EPOLLOUT)) {
-    client_->writer()->SetWritable();
-    client_->session()->connection()->OnCanWrite();
-  }
-  if (event->in_events & EPOLLERR) {
-    QUIC_DLOG(INFO) << "Epollerr";
-  }
-}
-
-QuicPacketWriter* QuicClientEpollNetworkHelper::CreateQuicPacketWriter() {
-  return new QuicDefaultPacketWriter(GetLatestFD());
-}
-
-void QuicClientEpollNetworkHelper::SetClientPort(int port) {
-  fd_address_map_.back().second =
-      QuicSocketAddress(GetLatestClientAddress().host(), port);
-}
-
-QuicSocketAddress QuicClientEpollNetworkHelper::GetLatestClientAddress() const {
-  if (fd_address_map_.empty()) {
-    return QuicSocketAddress();
-  }
-
-  return fd_address_map_.back().second;
-}
-
-int QuicClientEpollNetworkHelper::GetLatestFD() const {
-  if (fd_address_map_.empty()) {
-    return -1;
-  }
-
-  return fd_address_map_.back().first;
-}
-
-void QuicClientEpollNetworkHelper::ProcessPacket(
-    const QuicSocketAddress& self_address,
-    const QuicSocketAddress& peer_address, const QuicReceivedPacket& packet) {
-  client_->session()->ProcessUdpPacket(self_address, peer_address, packet);
-}
-
-int QuicClientEpollNetworkHelper::CreateUDPSocket(
-    QuicSocketAddress server_address, bool* overflow_supported) {
-  QuicUdpSocketApi api;
-  int fd = api.Create(server_address.host().AddressFamilyToInt(),
-                      /*receive_buffer_size =*/kDefaultSocketReceiveBuffer,
-                      /*send_buffer_size =*/kDefaultSocketReceiveBuffer);
-  if (fd < 0) {
-    return fd;
-  }
-
-  *overflow_supported = api.EnableDroppedPacketCount(fd);
-  api.EnableReceiveTimestamp(fd);
-
-  std::string interface_name = client_->interface_name();
-  if (!interface_name.empty()) {
-    if (!api.BindInterface(fd, interface_name)) {
-      QUIC_DLOG(WARNING) << "Failed to bind socket (" << fd
-                         << ") to interface (" << interface_name << ").";
-
-      CleanUpUDPSocket(fd);
-      return kQuicInvalidSocketFd;
-    }
-  }
-
-  return fd;
-}
-}  // namespace quic
diff --git a/quiche/quic/tools/quic_client_epoll_network_helper.h b/quiche/quic/tools/quic_client_epoll_network_helper.h
deleted file mode 100644
index 637af45..0000000
--- a/quiche/quic/tools/quic_client_epoll_network_helper.h
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// An implementation of the QuicClientBase::NetworkHelper
-// that is based off the epoll server.
-
-#ifndef QUICHE_QUIC_TOOLS_QUIC_CLIENT_EPOLL_NETWORK_HELPER_H_
-#define QUICHE_QUIC_TOOLS_QUIC_CLIENT_EPOLL_NETWORK_HELPER_H_
-
-#include <cstdint>
-#include <memory>
-#include <string>
-
-#include "quiche/quic/core/http/quic_client_push_promise_index.h"
-#include "quiche/quic/core/quic_config.h"
-#include "quiche/quic/core/quic_packet_reader.h"
-#include "quiche/quic/platform/api/quic_epoll.h"
-#include "quiche/quic/tools/quic_client_base.h"
-#include "quiche/common/quiche_linked_hash_map.h"
-
-namespace quic {
-
-namespace test {
-class QuicClientPeer;
-}  // namespace test
-
-// An implementation of the QuicClientBase::NetworkHelper based off
-// the epoll server.
-class QuicClientEpollNetworkHelper : public QuicClientBase::NetworkHelper,
-                                     public QuicEpollCallbackInterface,
-                                     public ProcessPacketInterface {
- public:
-  // Create a quic client, which will have events managed by an externally owned
-  // EpollServer.
-  QuicClientEpollNetworkHelper(QuicEpollServer* epoll_server,
-                               QuicClientBase* client);
-  QuicClientEpollNetworkHelper(const QuicClientEpollNetworkHelper&) = delete;
-  QuicClientEpollNetworkHelper& operator=(const QuicClientEpollNetworkHelper&) =
-      delete;
-
-  ~QuicClientEpollNetworkHelper() override;
-
-  // Return a name describing the class for use in debug/error reporting.
-  std::string Name() const override;
-
-  // From EpollCallbackInterface
-  void OnRegistration(QuicEpollServer* eps, int fd, int event_mask) override;
-  void OnModification(int fd, int event_mask) override;
-  void OnEvent(int fd, QuicEpollEvent* event) override;
-  // |fd_| can be unregistered without the client being disconnected. This
-  // happens in b3m QuicProber where we unregister |fd_| to feed in events to
-  // the client from the SelectServer.
-  void OnUnregistration(int fd, bool replaced) override;
-  void OnShutdown(QuicEpollServer* eps, int fd) override;
-
-  // From ProcessPacketInterface. This will be called for each received
-  // packet.
-  void ProcessPacket(const QuicSocketAddress& self_address,
-                     const QuicSocketAddress& peer_address,
-                     const QuicReceivedPacket& packet) override;
-
-  // From NetworkHelper.
-  void RunEventLoop() override;
-  bool CreateUDPSocketAndBind(QuicSocketAddress server_address,
-                              QuicIpAddress bind_to_address,
-                              int bind_to_port) override;
-  void CleanUpAllUDPSockets() override;
-  QuicSocketAddress GetLatestClientAddress() const override;
-  QuicPacketWriter* CreateQuicPacketWriter() override;
-
-  // Accessors provided for convenience, not part of any interface.
-
-  QuicEpollServer* epoll_server() { return epoll_server_; }
-
-  const quiche::QuicheLinkedHashMap<int, QuicSocketAddress>& fd_address_map()
-      const {
-    return fd_address_map_;
-  }
-
-  // If the client has at least one UDP socket, return the latest created one.
-  // Otherwise, return -1.
-  int GetLatestFD() const;
-
-  // Create socket for connection to |server_address| with default socket
-  // options.
-  // Return fd index.
-  virtual int CreateUDPSocket(QuicSocketAddress server_address,
-                              bool* overflow_supported);
-
-  QuicClientBase* client() { return client_; }
-
-  void set_max_reads_per_epoll_loop(int num_reads) {
-    max_reads_per_epoll_loop_ = num_reads;
-  }
-  // If |fd| is an open UDP socket, unregister and close it. Otherwise, do
-  // nothing.
-  void CleanUpUDPSocket(int fd);
-
- private:
-  friend class test::QuicClientPeer;
-
-  // Used for testing.
-  void SetClientPort(int port);
-
-  // Actually clean up |fd|.
-  void CleanUpUDPSocketImpl(int fd);
-
-  // Listens for events on the client socket.
-  QuicEpollServer* epoll_server_;
-
-  // Map mapping created UDP sockets to their addresses. By using linked hash
-  // map, the order of socket creation can be recorded.
-  quiche::QuicheLinkedHashMap<int, QuicSocketAddress> fd_address_map_;
-
-  // If overflow_supported_ is true, this will be the number of packets dropped
-  // during the lifetime of the server.
-  QuicPacketCount packets_dropped_;
-
-  // True if the kernel supports SO_RXQ_OVFL, the number of packets dropped
-  // because the socket would otherwise overflow.
-  bool overflow_supported_;
-
-  // Point to a QuicPacketReader object on the heap. The reader allocates more
-  // space than allowed on the stack.
-  std::unique_ptr<QuicPacketReader> packet_reader_;
-
-  QuicClientBase* client_;
-
-  int max_reads_per_epoll_loop_;
-};
-
-}  // namespace quic
-
-#endif  // QUICHE_QUIC_TOOLS_QUIC_CLIENT_EPOLL_NETWORK_HELPER_H_
diff --git a/quiche/quic/tools/quic_client_test.cc b/quiche/quic/tools/quic_client_test.cc
deleted file mode 100644
index c3de889..0000000
--- a/quiche/quic/tools/quic_client_test.cc
+++ /dev/null
@@ -1,136 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "quiche/quic/tools/quic_client.h"
-
-#include <dirent.h>
-#include <sys/types.h>
-
-#include <memory>
-#include <utility>
-
-#include "absl/strings/match.h"
-#include "absl/strings/string_view.h"
-#include "quiche/quic/platform/api/quic_epoll.h"
-#include "quiche/quic/platform/api/quic_test.h"
-#include "quiche/quic/platform/api/quic_test_loopback.h"
-#include "quiche/quic/test_tools/crypto_test_utils.h"
-
-namespace quic {
-namespace test {
-namespace {
-
-const char* kPathToFds = "/proc/self/fd";
-
-// Return the value of a symbolic link in |path|, if |path| is not found, return
-// an empty string.
-std::string ReadLink(const std::string& path) {
-  std::string result(PATH_MAX, '\0');
-  ssize_t result_size = readlink(path.c_str(), &result[0], result.size());
-  if (result_size < 0 && errno == ENOENT) {
-    return "";
-  }
-  QUICHE_CHECK(result_size > 0 &&
-               static_cast<size_t>(result_size) < result.size())
-      << "result_size:" << result_size << ", errno:" << errno
-      << ", path:" << path;
-  result.resize(result_size);
-  return result;
-}
-
-// Counts the number of open sockets for the current process.
-size_t NumOpenSocketFDs() {
-  size_t socket_count = 0;
-  dirent* file;
-  std::unique_ptr<DIR, int (*)(DIR*)> fd_directory(opendir(kPathToFds),
-                                                   closedir);
-  while ((file = readdir(fd_directory.get())) != nullptr) {
-    absl::string_view name(file->d_name);
-    if (name == "." || name == "..") {
-      continue;
-    }
-
-    std::string fd_path = ReadLink(absl::StrCat(kPathToFds, "/", name));
-    if (absl::StartsWith(fd_path, "socket:")) {
-      socket_count++;
-    }
-  }
-  return socket_count;
-}
-
-class QuicClientTest : public QuicTest {
- public:
-  QuicClientTest() {
-    // Creates and destroys a single client first which may open persistent
-    // sockets when initializing platform dependencies like certificate
-    // verifier. Future creation of addtional clients will deterministically
-    // open one socket per client.
-    CreateAndInitializeQuicClient();
-  }
-
-  // Creates a new QuicClient and Initializes it on an unused port.
-  // Caller is responsible for deletion.
-  std::unique_ptr<QuicClient> CreateAndInitializeQuicClient() {
-    QuicSocketAddress server_address(QuicSocketAddress(TestLoopback(), 0));
-    QuicServerId server_id("hostname", server_address.port(), false);
-    ParsedQuicVersionVector versions = AllSupportedVersions();
-    auto client = std::make_unique<QuicClient>(
-        server_address, server_id, versions, &epoll_server_,
-        crypto_test_utils::ProofVerifierForTesting());
-    EXPECT_TRUE(client->Initialize());
-    return client;
-  }
-
- private:
-  QuicEpollServer epoll_server_;
-};
-
-TEST_F(QuicClientTest, DoNotLeakSocketFDs) {
-  // Make sure that the QuicClient doesn't leak socket FDs. Doing so could cause
-  // port exhaustion in long running processes which repeatedly create clients.
-
-  // Record the initial number of FDs.
-  size_t number_of_open_fds = NumOpenSocketFDs();
-
-  // Create a number of clients, initialize them, and verify this has resulted
-  // in additional FDs being opened.
-  const int kNumClients = 50;
-  for (int i = 0; i < kNumClients; ++i) {
-    EXPECT_EQ(number_of_open_fds, NumOpenSocketFDs());
-    std::unique_ptr<QuicClient> client(CreateAndInitializeQuicClient());
-    // Initializing the client will create a new FD.
-    EXPECT_EQ(number_of_open_fds + 1, NumOpenSocketFDs());
-  }
-
-  // The FDs created by the QuicClients should now be closed.
-  EXPECT_EQ(number_of_open_fds, NumOpenSocketFDs());
-}
-
-TEST_F(QuicClientTest, CreateAndCleanUpUDPSockets) {
-  size_t number_of_open_fds = NumOpenSocketFDs();
-
-  std::unique_ptr<QuicClient> client(CreateAndInitializeQuicClient());
-  // Creating and initializing a client will result in one socket being opened.
-  EXPECT_EQ(number_of_open_fds + 1, NumOpenSocketFDs());
-
-  // Create more UDP sockets.
-  EXPECT_TRUE(client->network_helper()->CreateUDPSocketAndBind(
-      client->server_address(), client->bind_to_address(),
-      client->local_port()));
-  EXPECT_EQ(number_of_open_fds + 2, NumOpenSocketFDs());
-  EXPECT_TRUE(client->network_helper()->CreateUDPSocketAndBind(
-      client->server_address(), client->bind_to_address(),
-      client->local_port()));
-  EXPECT_EQ(number_of_open_fds + 3, NumOpenSocketFDs());
-
-  // Clean up UDP sockets.
-  client->epoll_network_helper()->CleanUpUDPSocket(client->GetLatestFD());
-  EXPECT_EQ(number_of_open_fds + 2, NumOpenSocketFDs());
-  client->epoll_network_helper()->CleanUpUDPSocket(client->GetLatestFD());
-  EXPECT_EQ(number_of_open_fds + 1, NumOpenSocketFDs());
-}
-
-}  // namespace
-}  // namespace test
-}  // namespace quic