[PR #1560] [CLOSED] Change transport traits to use instance methods. #2419

Closed
opened 2026-03-16 08:52:44 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1560
Author: @pinkisemils
Created: 10/5/2021
Status: Closed

Base: mainHead: change-transport-traits


📝 Commits (6)

  • c3dc0d9 Implement Tokio traits for AsyncIoTokioAsAstd
  • 4d6802e Add UdpSocketBinder
  • ecb9c95 Add TcpConnector trait
  • 0f936dc Combine TcpConnector and UdpBinder
  • 9a03a75 Stop using async_trait
  • e83c074 Inline trait methods

📊 Changes

60 files changed (+803 additions, -677 deletions)

View changed files

📝 Cargo.lock (+1 -0)
📝 bin/benches/comparison_benches.rs (+7 -9)
📝 bin/tests/named_https_tests.rs (+4 -5)
📝 bin/tests/named_rustls_tests.rs (+5 -8)
📝 bin/tests/named_test_rsa_dnssec.rs (+2 -2)
📝 bin/tests/named_tests.rs (+15 -17)
📝 crates/async-std-resolver/src/lib.rs (+3 -3)
📝 crates/async-std-resolver/src/net.rs (+3 -18)
📝 crates/async-std-resolver/src/runtime.rs (+33 -19)
📝 crates/async-std-resolver/src/tests.rs (+20 -40)
📝 crates/client/src/client/client.rs (+6 -4)
📝 crates/client/src/https_client_connection.rs (+11 -9)
📝 crates/client/src/lib.rs (+8 -6)
📝 crates/client/src/tcp/tcp_client_connection.rs (+24 -17)
📝 crates/client/src/udp/udp_client_connection.rs (+22 -11)
📝 crates/proto/src/error.rs (+1 -0)
📝 crates/proto/src/https/https_client_stream.rs (+38 -32)
📝 crates/proto/src/lib.rs (+31 -0)
📝 crates/proto/src/native_tls/tests.rs (+2 -2)
📝 crates/proto/src/native_tls/tls_client_stream.rs (+11 -10)

...and 40 more files

📄 Description

I've changed the transport traits to use instance methods when creating the underlying sockets. This is useful to not rely on static variables if creating sockets relies on configuration that can change at runtime. The changes themselves are somewhat banal, with most of it being changes to the testing code, whereas the server implementation code itself has had no changes at all. There are also some changes that just some imports for testing.

For now, the RuntimeProvider::Handle type is expected to implement TcpConnector and UdpSocketBinder traits, but this gets a bit messy. I'm unsure if the Handle should have a trait of it's own that then depends on TcpConnector, Spawn and UdpSocketBinder, or just have 3 separate handle structs.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/1560 **Author:** [@pinkisemils](https://github.com/pinkisemils) **Created:** 10/5/2021 **Status:** ❌ Closed **Base:** `main` ← **Head:** `change-transport-traits` --- ### 📝 Commits (6) - [`c3dc0d9`](https://github.com/hickory-dns/hickory-dns/commit/c3dc0d93ca98dfe03cfb4f95ec53aaed4eadaa61) Implement Tokio traits for AsyncIoTokioAsAstd - [`4d6802e`](https://github.com/hickory-dns/hickory-dns/commit/4d6802e5b003fd5a6c0d11fac58458c29e152157) Add UdpSocketBinder - [`ecb9c95`](https://github.com/hickory-dns/hickory-dns/commit/ecb9c95bb868deebd5b776ba09a61dab586fab65) Add TcpConnector trait - [`0f936dc`](https://github.com/hickory-dns/hickory-dns/commit/0f936dc0d8f26ba52f4ac1357b5183489cdaa3cc) Combine TcpConnector and UdpBinder - [`9a03a75`](https://github.com/hickory-dns/hickory-dns/commit/9a03a7592e7e011ad544188540c6718ab07b38d9) Stop using async_trait - [`e83c074`](https://github.com/hickory-dns/hickory-dns/commit/e83c07413c4614504253fbdba26fd0fd2411ded2) Inline trait methods ### 📊 Changes **60 files changed** (+803 additions, -677 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+1 -0) 📝 `bin/benches/comparison_benches.rs` (+7 -9) 📝 `bin/tests/named_https_tests.rs` (+4 -5) 📝 `bin/tests/named_rustls_tests.rs` (+5 -8) 📝 `bin/tests/named_test_rsa_dnssec.rs` (+2 -2) 📝 `bin/tests/named_tests.rs` (+15 -17) 📝 `crates/async-std-resolver/src/lib.rs` (+3 -3) 📝 `crates/async-std-resolver/src/net.rs` (+3 -18) 📝 `crates/async-std-resolver/src/runtime.rs` (+33 -19) 📝 `crates/async-std-resolver/src/tests.rs` (+20 -40) 📝 `crates/client/src/client/client.rs` (+6 -4) 📝 `crates/client/src/https_client_connection.rs` (+11 -9) 📝 `crates/client/src/lib.rs` (+8 -6) 📝 `crates/client/src/tcp/tcp_client_connection.rs` (+24 -17) 📝 `crates/client/src/udp/udp_client_connection.rs` (+22 -11) 📝 `crates/proto/src/error.rs` (+1 -0) 📝 `crates/proto/src/https/https_client_stream.rs` (+38 -32) 📝 `crates/proto/src/lib.rs` (+31 -0) 📝 `crates/proto/src/native_tls/tests.rs` (+2 -2) 📝 `crates/proto/src/native_tls/tls_client_stream.rs` (+11 -10) _...and 40 more files_ </details> ### 📄 Description I've changed the transport traits to use instance methods when creating the underlying sockets. This is useful to not rely on static variables if creating sockets relies on configuration that can change at runtime. The changes themselves are somewhat banal, with most of it being changes to the testing code, whereas the server implementation code itself has had no changes at all. There are also some changes that just some imports for testing. For now, the `RuntimeProvider::Handle` type is expected to implement `TcpConnector` and `UdpSocketBinder` traits, but this gets a bit messy. I'm unsure if the `Handle` should have a trait of it's own that then depends on `TcpConnector`, `Spawn` and `UdpSocketBinder`, or just have 3 separate handle structs. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 08:52:44 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#2419
No description provided.