Compare commits

...

6 Commits

Author SHA1 Message Date
Taiki Endo 8d56482050
Merge pull request #19 from smol-rs/next
Bump to v1.6.1
2021-06-30 22:58:26 +09:00
Taiki Endo 50ee731758 Bump to v1.6.1 2021-06-30 22:56:22 +09:00
Taiki Endo 3af3edb76c
Merge pull request #18 from smol-rs/deps
Remove direct dependency on fastrand
2021-06-30 22:24:32 +09:00
Taiki Endo 164443584b Remove direct dependency on fastrand 2021-06-30 22:22:04 +09:00
Taiki Endo a5b175921b
Merge pull request #16 from smol-rs/taiki-e/owned
Use Async::{readable_owned, writable_owned}
2021-06-30 21:44:55 +09:00
Taiki Endo 583df1640c Use Async::{readable_owned, writable_owned} 2021-06-30 21:39:11 +09:00
4 changed files with 18 additions and 14 deletions

View File

@ -1,3 +1,8 @@
# Version 1.6.1
- Override `AsyncWrite::poll_write_vectored` for `TcpStream`.
- Remove boxed futures from `TcpStream` and `UnixStream`.
# Version 1.6.0
- Add `From` impls for conversion into inner networking types `Arc<Async<T>>`. (#12)

View File

@ -3,7 +3,7 @@ name = "async-net"
# When publishing a new version:
# - Update CHANGELOG.md
# - Create "v1.x.y" git tag
version = "1.6.0"
version = "1.6.1"
authors = ["Stjepan Glavina <stjepang@gmail.com>"]
edition = "2018"
description = "Async networking primitives for TCP/UDP/Unix communication"
@ -15,7 +15,6 @@ keywords = ["networking", "uds", "mio", "reactor", "std"]
categories = ["asynchronous", "network-programming", "os"]
[dependencies]
async-io = "1.5.0"
async-io = "1.6.0"
blocking = "1.0.0"
fastrand = "1.3.5"
futures-lite = "1.11.0"

View File

@ -303,8 +303,8 @@ impl fmt::Debug for Incoming<'_> {
/// ```
pub struct TcpStream {
inner: Arc<Async<std::net::TcpStream>>,
readable: Option<async_io::Readable>,
writable: Option<async_io::Writable>,
readable: Option<async_io::ReadableOwned<std::net::TcpStream>>,
writable: Option<async_io::WritableOwned<std::net::TcpStream>>,
}
impl UnwindSafe for TcpStream {}
@ -599,7 +599,7 @@ impl AsyncRead for TcpStream {
// Initialize the future to wait for readiness.
if self.readable.is_none() {
self.readable = Some(self.inner.readable());
self.readable = Some(self.inner.clone().readable_owned());
}
// Poll the future for readiness.
@ -630,7 +630,7 @@ impl AsyncWrite for TcpStream {
// Initialize the future to wait for readiness.
if self.writable.is_none() {
self.writable = Some(self.inner.writable());
self.writable = Some(self.inner.clone().writable_owned());
}
// Poll the future for readiness.
@ -655,7 +655,7 @@ impl AsyncWrite for TcpStream {
// Initialize the future to wait for readiness.
if self.writable.is_none() {
self.writable = Some(self.inner.writable());
self.writable = Some(self.inner.clone().writable_owned());
}
// Poll the future for readiness.
@ -688,7 +688,7 @@ impl AsyncWrite for TcpStream {
// Initialize the future to wait for readiness.
if self.writable.is_none() {
self.writable = Some(self.inner.writable());
self.writable = Some(self.inner.clone().writable_owned());
}
// Poll the future for readiness.

View File

@ -234,8 +234,8 @@ impl fmt::Debug for Incoming<'_> {
/// ```
pub struct UnixStream {
inner: Arc<Async<std::os::unix::net::UnixStream>>,
readable: Option<async_io::Readable>,
writable: Option<async_io::Writable>,
readable: Option<async_io::ReadableOwned<std::os::unix::net::UnixStream>>,
writable: Option<async_io::WritableOwned<std::os::unix::net::UnixStream>>,
}
impl UnwindSafe for UnixStream {}
@ -396,7 +396,7 @@ impl AsyncRead for UnixStream {
// Initialize the future to wait for readiness.
if self.readable.is_none() {
self.readable = Some(self.inner.readable());
self.readable = Some(self.inner.clone().readable_owned());
}
// Poll the future for readiness.
@ -427,7 +427,7 @@ impl AsyncWrite for UnixStream {
// Initialize the future to wait for readiness.
if self.writable.is_none() {
self.writable = Some(self.inner.writable());
self.writable = Some(self.inner.clone().writable_owned());
}
// Poll the future for readiness.
@ -452,7 +452,7 @@ impl AsyncWrite for UnixStream {
// Initialize the future to wait for readiness.
if self.writable.is_none() {
self.writable = Some(self.inner.writable());
self.writable = Some(self.inner.clone().writable_owned());
}
// Poll the future for readiness.