Removing the need for the net2 crate.
On Unix platforms (expect for iOS, macOS and Solaris) this reduces the
number of system calls from four to two, on iOS, macOS and Solaris this
reduces it to three system calls.
# Windows net initialization
The standard library calls WSAStartup for us, ensuring (with an assert)
that the return value is ok. This means that we can't initialise it
ourselves and need to let the standard library do it for us. To work
around this we create and drop a UdpSocket (from std::net).
Rewrite the windows implementation using the [wepoll] strategy. This uses the
windows AFD system to access socket readiness events. By doing this, mio no
longer needs to buffer reads and writes internally.
Closes#1024.
[wepoll]: https://github.com/piscisaureus/wepoll
* Remove unused export of IoVec
* Fix type definitions for kevent
* Add syscall macro
* Start NEXT_ID at 1
* Optimize Selector::register to pass a single event to kevent when possible.
* Document when and why some errors returned by kevent are ignored.
* Move calling kevent and checking of errors into there own functions to allow for greater reuse.
* Rename epfd to ep, the type already says it's a file descriptor.
* Use Duration::as_millis, removing the millis function.
* Document unsafe blocks.
* Remove the unneeded info event from deregister as Linux < 2.6.9 is no longer supported.
* Log errors when closing the epoll fd.
pass-by-value is faster than pass-by-reference for types that are small
and Copy. This is technically a breaking change since these methods are
public. However, most crates should compile fine because the only
method argument that's changing is `&self`, which is provided
implicitly. The only way to get into trouble would be something like
this:
let interests = Interests::new;
Interests::is_readable(&ready)
Changes sys::Event to be an alias for the platform specific event, e.g.
kevent or epoll_event, what SysEvent used to be.
Next all methods on the old sys::Event become standalone functions in a
new sys::event module, which are used by crate::Event.
* Remove pipe and set_nonblock unix export (not used).
* Move sys::unix::pipe to sys::Waker
Only place where it is used. And since the Waker based is only used on certain platforms directly use pipe2. All the platforms that use pipe based Waker have the pipe2 system call.
* Always use epoll_create1 on epoll platforms
epoll_create1 was introduces in Linux kernel version 2.6.27.
* Remove dlsym module (not used).
* Silence unused warning for set_cloexec (not used).
* Remove sys::unix::io::Io (not used).