Skip to content

Readable includes hup, but writable doesn't #274

Open
@cramertj

Description

@cramertj

I've spent quite a while looking at this code and trying to understand it, but I'm failing. poll_read checks the bits included in read_ready, which includes hup. poll_write, however, doesn't include hup-- it just checks the writable signal. Why is this? IMO it's weird that poll_read is ready on hup, but I understand the idea is to push users to attempt a read and then read the remaining data before discovering that the FD is closed. Additionally, since mio makes no guarantees about sending incorrect signals, you can't guarantee that seeing a hup means that the FD is closed. However, I'd expect the same things to apply to writing (not just reading). What was the logic here?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions