From 5749ff7114b7ad22b54df0583ce8d1d6b55916cb Mon Sep 17 00:00:00 2001 From: Alex Good Date: Tue, 10 Mar 2026 14:36:14 +0000 Subject: [PATCH] Re-introduce TcpDialer::new_host_port --- CHANGELOG.md | 15 ++++++++++----- samod/src/tokio_io.rs | 4 ++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8180c2..fe5b80d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,16 @@ ## Unreleased -- `TcpDialer` now simply takes a `Url` parameter, rather than a host and a port or a socket address. -- Added a convenience `repo.dial_tcp()` method to simplify construction of `TcpDialer`. -- Allow documents syncing over the TCP transport to be up to 8gb size instead of Tokio's default 8mb frame size -- Exposed receiving `ConnectionHandle`s via `accept()`. Users can now subscribe to an `events()` stream directly - on the handle, or `await` for `handshake_completed()`. +### Added + +- `TcpDialer::new` which takes a `Url` parameter, rather than a host and a port + or a socket address. +- `Repo::dial_tcp()` to simplify construction of `TcpDialer`. +- Allow documents syncing over the TCP transport to be up to 8gb size instead + of Tokio's default 8mb frame size +- Exposed receiving `ConnectionHandle`s via `accept()`. Users can now subscribe + to an `events()` stream directly on the handle, or `await` for + `handshake_completed()`. ## 0.8.0 - 2024-03-06 diff --git a/samod/src/tokio_io.rs b/samod/src/tokio_io.rs index 001e472..34364f9 100644 --- a/samod/src/tokio_io.rs +++ b/samod/src/tokio_io.rs @@ -72,6 +72,10 @@ impl std::fmt::Debug for TcpDialerError { impl std::error::Error for TcpDialerError {} impl TcpDialer { + pub fn new_host_port(host: String, port: u16) -> Self { + Self { host, port } + } + /// Create a dialer which will resolve the given [`Url`]. /// The [`Url`] must have the scheme `tcp://`, and must have a valid [`Url::host`] and [`Url::port`]. pub fn new(url: Url) -> Result {