etcimon / libasync

Cross-platform event loop library of asynchronous objects
MIT License
147 stars 30 forks source link

kqueue: O_NONBLOCK is inherited by accepted sockets? #63

Closed MoritzMaxeiner closed 8 years ago

MoritzMaxeiner commented 8 years ago

From what I can tell from the accept(2) man pages for OS X and FreeBSD, respective

creates a new socket with the same properties of socket

and

allocates a new file descriptor for the socket which inherits the state of the O_NONBLOCK and O_ASYNC properties

I would think that this is superfluous?

etcimon commented 8 years ago

I hadn't had the chance to test that out, I wanted to stay on the safe side. Would have to try running an app and check the logs to make sure it's not blocking

MoritzMaxeiner commented 8 years ago

Hm, I get where you're coming from, I would just add, that if they are not blocking on OS X or FreeBSD that would be (according to their manuals) a bug they would need to fix (and we would need to report that to them).

etcimon commented 8 years ago

Of course, it's very likely to work fine if we remove these 2 lines