Commit Graph

18 Commits

Author SHA1 Message Date
John Nunley 24900fb662
m(windows): Reimplement Wepoll in Rust (#88)
Reimplements the C-based wepoll backend in Rust, using some handwritten code. This PR also implements bindings to the I/O Completion Ports and \Device\Afd APIs. For more information on the latter, see my blog post on the subject: https://notgull.github.io/device-afd/

Note that the IOCP API is wrapped using a `Pin`-oriented "CompletionHandle" system that is relatively brittle. This should be replaced with a better model when one becomes available.
2023-03-05 16:25:25 -08:00
John Nunley 97e6ecd0d0
Support tvOS and watchOS (#60) 2022-12-19 19:54:45 -08:00
Taiki Endo 0b45549097
Test x86_64-pc-windows-gnu with Wine on CI (#53) 2022-11-30 23:21:01 +09:00
Taiki Endo 4ac15ff339
Merge pull request #26 from Kestrer/master
Support VxWorks, Fuchsia and other Unix systems by using poll
2021-09-11 18:09:28 +09:00
Kestrer 1930801c40 Document `poll` support in README 2021-09-04 18:00:25 +01:00
Taiki Endo 458d5c9101 Update license badge to match Cargo.toml 2021-02-14 13:36:54 +09:00
Taiki Endo 99d9e20ba0 Update URLs 2020-12-26 23:47:13 +09:00
Stjepan Glavina 0a299cf060 Small cleanup 2020-10-02 17:34:53 +02:00
Yorick Peterse ba05307af1
Separate adding and modifying of file descriptors
This replaces Poller.insert() and Poller.interest() with Poller.add()
and Poller.modify(), and renames Poller.remove() to Poller.delete().

The method Poller.add() is used for adding a new file descriptor, while
Poller.modify() is used for updating an existing one. Poller.remove() is
renamed to Poller.delete() so the naming scheme of these methods follows
that of epoll, wepoll, etc.

This new setup means that adding a new socket only requires a single
call of Poller.add(), instead of a combination of Poller.insert() and
Poller.interest(). This reduces the amount of system calls necessary,
and leads to a more pleasant API.

On systems that use kqueue or ports, the behaviour of Poller.add() and
Poller.modify() is the same. This is because on these systems adding an
already existing file descriptor will just update its configuration.
This however is an implementation detail and should not be relied upon
by users.

Migrating to this new API is pretty simple, simply replace this:

    poller.insert(&socket);
    poller.interest(&socket, event);

With this:

    poller.add(&socket, event);

And for cases where Poller.interest() was used for updating an existing
file descriptor, simply replace it will a call to Poller.modify().

See https://github.com/stjepang/polling/issues/16 and
https://github.com/stjepang/polling/pull/17 for more information.
2020-10-01 21:50:59 +02:00
Yorick Peterse 4e5c3ce836
Don't automatically make descriptors non-blocking
This adds redundant system call overhead for file descriptors which have
already been turned into non-blocking file descriptors. In addition, the
polling crate doesn't need to implement platform specific code for
enabling non-blocking mode. Instead, users of polling can do so using
(for example) standard library methods such as
TcpListener.set_nonblocking().

See https://github.com/stjepang/polling/issues/16 for more information.
2020-10-01 20:06:07 +02:00
Stjepan Glavina 1992605564 Bump to v1.0.1 2020-09-07 19:41:24 +02:00
Stjepan Glavina eb1f0872ef
Merge pull request #1 from GuillaumeGomez/doc-comment
Add doc-comment to test README's examples
2020-08-13 20:58:13 +02:00
Stjepan Glavina 0289558227
Update README.md 2020-08-11 13:16:00 +02:00
Stjepan Glavina 30ca45f83f
Merge pull request #3 from papertigers/illumos
Add event ports for illumos
2020-08-11 13:15:36 +02:00
Stjepan Glavina 08745b5c50 Document non-blocking mode 2020-08-08 10:20:19 +02:00
Mike Zeller a17f28d26c Add event ports for illumos 2020-08-06 20:42:44 +00:00
Guillaume Gomez 8d77ab712f Add doc-comment to test README's examples 2020-08-06 16:12:52 +02:00
Stjepan Glavina 5b32dd8e82 Initial commit 2020-08-06 15:05:24 +02:00