Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from tokio-rs:master #1

Open
wants to merge 643 commits into
base: master
Choose a base branch
from

Conversation

pull[bot]
Copy link

@pull pull bot commented Sep 8, 2019

See Commits and Changes for more details.


Created by pull[bot]. Want to support this open source service? Please star it : )

@pull pull bot added the ⤵️ pull label Sep 8, 2019
Jake-Shadle and others added 29 commits March 31, 2022 10:34
Per the Linux manual:
> EAGAIN For nonblocking UNIX domain sockets, the socket is
>        nonblocking, and the connection cannot be completed
>        immediately.

Previously the code incorrectly assumed that the connection was now in
progress, which is incorrect. If that were the case EINPROGRESS
would/should be returned by the OS
This is a reflect of the Linux manual, which unfortunately doesn't
specify how to determine when the connect call should be retried.
Removes the need for the Win32_NetworkManagement_IpHelper feature as
AF_INET and AF_INET6 are now included in the Win32_Networking_WinSock
feature.
FreeBSD 12 adds some new private fields to struct kevent, and it changes
the type of "data" from intptr_t to i64.  For now libc only binds the
11-compat ABI, but that will change some day.  Adjust mio's structure
definitions for compatibility with either ABI.

This should work on all 32 and 64 bit platforms.
Signed-off-by: Tricster <[email protected]>
Using epoll_create() as a fallback.

Fix #1473.
Thomasdezeeuw and others added 30 commits June 14, 2024 12:28
1.70.0 should be the same as 1.70.
Once upon a time Mio had support for Fuchsia using Fuchsia specific
code. That code was unmaintained and removed at some point. Since then
Fuchsia added support for (part of) the Posix model, making the port
much easier.

This implementation uses the poll(2) implementation for Poll, and
eventfd(2) for the Waker.
Using the old method in src/sys/unix/selector/mod.rs we needed to define
all the targets twice, now we just do it once and set the path to the
correct selector implementation.

Note that is only possible because we increased MSRV so that it supports
the path attribute, when the code was originally written this was not a
thing.
The old macro was a mess of not(any(targets...)), means that when
porting to a new target you always used the stateless implementation
even if you didn't know about it.

This fixes gotcha that and moves the logic of what kind of IoSourceState
to use to the selector implemtnation files, which means that we don't
have to worry about it when porting to a new platform.
Initially I though this would give a nice error message saying that
platform X wasn't supported. But due to the amount of other errors the
error message is still not great.

So, to make porting easier in the future, just remove this and we'll get
a `fds` not defined error.
Means we can remove the cfg_io_source! macro usage as that is already
done in the selector implementation file.
And make it not pub, but pub(crate).

No functional changes.
Also makes the pub -> pub(crate) change.

No functional changes.
Also here the change from pub to pub(crate) was made.

No functional changes.
And rename it to WakerInternal where needed.
This is because we're going to use a similar list of cfg attributes to
the list we use for selector, so it's beneficial to have them close
together.
So we don't have to define it twice. Similar change as we made for the
selector module.
To be used in the poll implementation.
Same as what we did for the selector.

But for the waker it's a little more complicated due to the poll(2)
implementation. That needs to wrap the Waker type to use it's internal
waker, compared to kqueue and epoll which just reexport the Waker
directly.

This logical of what waker to use is now moved to the selector module.
For kqueue and epoll it's a simple export, for poll it's a special type
that call the internal waker. This special poll waker used to be the
fdbased waker.

All these changes (hopefully) add up to no changes at all. All the
supported targets should continue to work with all configurations.
However it should be easier to port to new targets without having to
deal with the clusterfuck that was the old sys::unix::waker module.
Make that clear in the code.
Before passing it to SocketAddr::from_pathname.

This was a problem for Tokio's test suite where
uds_socket::listen_and_stream failed. We can't reproduce the problem
with just Mio's type as Mio doesn't allow a UnixStream to bound to a
local path before connecting it.
It seems the same behaviour we seen for pipe waker implementation is
also true for eventfd. Work around this by resetting the waker before
writing to it.
The Hermit build would fail if --no-default-features --features os-ext
were passed as flags. This is because the cfg_io_source! macro assumed
that IoSource was needed for os-ext, which is true for Unix due to the
usage of the Unix pipe, but not true for Hermit (it doesn't support
Unix pipes).
Use directly libc as platform interface.
Implement `From<OwnedFd>` and `Into<OwnedFd>` for types that implement
`FromRawFd` and `IntoRawFd`.

And on Windows, implement `From<OwnedSocket>`, `Into<OwnedSocket>`, and
`AsSocket` for types that implement `FromRawSocket`, `IntoRawSocket`,
and `AsRawSocket`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.