Aaron Sethman wrote: > > > 2. you need to wrap your read()/write() calls on the socket with code > > that notices EWOULDBLOCK > This is perhaps the part we it disagrees with our code. I will > investigate this part. The way we normally do things is have callbacks > per fd, that get called when our event occurs doing the read, or, write > directly.
That sounds totally fine; in fact, it's how my Poller library works. > We do check for the EWOULDBLOCK stuff and re-register the > event. But do you remember that this fd is ready until EWOULDBLOCK? i.e. if you're notified that an fd is ready, and then you don't for whatever reason continue to do I/O on it until EWOULDBLOCK, you'll never ever be notified that it's ready again. If your code assumes that it will be notified again anyway, as with poll(), it will be sorely disappointed. > The thing we do not currently do is, attempt to read or write > unless we've received notification first. This is what I am assuming is > breaking it. Yeah, that would break it, too, I think. - Dan