Skip to content

TcpStream::close_read has platform-dependent semantics #19428

Closed
@jbapple

Description

@jbapple

Under the hood, TcpStream::close_read calls libc::shutdown(self.fd(), libc::SHUT_RD). According to http://stackoverflow.com/questions/14740852/linux-socket-close-vs-shutdown/14743440#14743440 ,

Unix will ACK it and throw it away; Linux will ACK it and buffer it, which will eventually stall the sender; Windows will issue an RST, which the sender sees as 'connection reset by peer'.

Should there be a note in the comment on close_read that the behavior is platform-dependent?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions