Skip to content

Commit

Permalink
transports/tcp: Simplify IfWatcher integration (#2813)
Browse files Browse the repository at this point in the history
With if-watch `2.0.0` `IfWatcher::new` is not async anymore, hence the
`IfWatch` wrapping logic is obsolete.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
  • Loading branch information
elenaf9 and thomaseizinger authored Sep 10, 2022
1 parent c650dc1 commit 457fb51
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 267 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@

# `libp2p` facade crate

# 0.49.0 - [unreleased]

- Update to [`libp2p-tcp` `v0.37.0`](transports/tcp/CHANGELOG.md#0370).

# 0.48.0

- Update to [`libp2p-core` `v0.36.0`](core/CHANGELOG.md#0360).
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p"
edition = "2021"
rust-version = "1.60.0"
description = "Peer-to-peer networking library"
version = "0.48.0"
version = "0.49.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand Down Expand Up @@ -110,7 +110,7 @@ smallvec = "1.6.1"
libp2p-deflate = { version = "0.36.0", path = "transports/deflate", optional = true }
libp2p-dns = { version = "0.36.0", path = "transports/dns", optional = true, default-features = false }
libp2p-mdns = { version = "0.40.0", path = "protocols/mdns", optional = true, default-features = false }
libp2p-tcp = { version = "0.36.0", path = "transports/tcp", default-features = false, optional = true }
libp2p-tcp = { version = "0.37.0", path = "transports/tcp", default-features = false, optional = true }
libp2p-websocket = { version = "0.38.0", path = "transports/websocket", optional = true }

[target.'cfg(not(target_os = "unknown"))'.dependencies]
Expand Down
7 changes: 7 additions & 0 deletions transports/tcp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 0.37.0 - [unreleased]

- Update to `if-watch` `v2.0.0`. Simplify `IfWatcher` integration.
Use `if_watch::IfWatcher` for all runtimes. See [PR 2813].

[PR 2813]: https://github.com/libp2p/rust-libp2p/pull/2813

# 0.36.0

- Update to `libp2p-core` `v0.36.0`.
Expand Down
12 changes: 5 additions & 7 deletions transports/tcp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "libp2p-tcp"
edition = "2021"
rust-version = "1.56.1"
description = "TCP/IP transport protocol for libp2p"
version = "0.36.0"
version = "0.37.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT"
repository = "https://github.com/libp2p/rust-libp2p"
Expand All @@ -14,9 +14,7 @@ categories = ["network-programming", "asynchronous"]
async-io-crate = { package = "async-io", version = "1.2.0", optional = true }
futures = "0.3.8"
futures-timer = "3.0"
if-watch = { version = "1.1.1", optional = true }
if-addrs = { version = "0.7.0", optional = true }
ipnet = "2.0.0"
if-watch = "2.0.0"
libc = "0.2.80"
libp2p-core = { version = "0.36.0", path = "../../core", default-features = false }
log = "0.4.11"
Expand All @@ -25,10 +23,10 @@ tokio-crate = { package = "tokio", version = "1.19.0", default-features = false,

[features]
default = ["async-io"]
tokio = ["tokio-crate", "if-addrs"]
async-io = ["async-io-crate", "if-watch"]
tokio = ["tokio-crate"]
async-io = ["async-io-crate"]

[dev-dependencies]
async-std = { version = "1.6.5", features = ["attributes"] }
tokio-crate = { package = "tokio", version = "1.0.1", default-features = false, features = ["net", "rt"] }
tokio-crate = { package = "tokio", version = "1.0.1", default-features = false, features = ["net", "rt", "macros"] }
env_logger = "0.9.0"
Loading

0 comments on commit 457fb51

Please sign in to comment.