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

Changed io::read/write to not use a loop and return a count of successfu... #57

Closed
wants to merge 1 commit into from

Conversation

rrichardson
Copy link
Contributor

changed io::read/write to not use a loop and also return a uint of the count that they wrote or read.
added reregister and register_opt functions to event_loop and the pollers that it uses.
moved event_loop::connect into net::

…sful read and written. Added reregister and register_opt to Poll functions
@carllerche
Copy link
Member

Looks good, missing kqueue support ATM though. I could take a stab at it when I have a moment.

@@ -74,7 +73,7 @@ impl<T, M: Send> EventLoop<T, M> {
let notify = try!(Notify::with_capacity(config.notify_capacity));

// Register the notification wakeup FD with the IO poller
try!(poll.register(&notify, NOTIFY));
try!(poll.register(&notify, NOTIFY, event::READABLE | event::WRITABLE, event::LEVEL));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be event::EDGE instead of event::LEVEL?
Seems to cause the event loop to constantly wake up otherwise (on linux atleast)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. This would be a good case for EDGE without ONESHOT, since
we're just waiting for the poll on the fd to timeout anyways.

On Tue, Nov 25, 2014 at 8:47 AM, Markus Kobler notifications@github.com
wrote:

In src/event_loop.rs:

@@ -74,7 +73,7 @@ impl<T, M: Send> EventLoop<T, M> {
let notify = try!(Notify::with_capacity(config.notify_capacity));

     // Register the notification wakeup FD with the IO poller
  •    try!(poll.register(&notify, NOTIFY));
    
  •    try!(poll.register(&notify, NOTIFY, event::READABLE | event::WRITABLE, event::LEVEL));
    

Should this not be event::EDGE instead of event::LEVEL?
Seems to cause the event loop to constantly wake up otherwise (on linux
atleast)


Reply to this email directly or view it on GitHub
https://github.com/carllerche/mio/pull/57/files#r20862879.

“Science is the great antidote to the poison of enthusiasm and
superstition.” -- Adam Smith

@carllerche
Copy link
Member

I am currently working on getting this PR to work with kqueue

@carllerche
Copy link
Member

Resolved by 0122914

@carllerche carllerche closed this Nov 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants