Skip to content

peek methods for UnixDatagram and UnixStream? #68565

Closed
@joshtriplett

Description

@joshtriplett

#38980 added peek and peek_from methods for UdpSocket, and added peek to TcpStream.

Would it be possible to add the peek and peek_from methods to UnixDatagram as well, and to add the peek method to UnixStream?

I would also be interested in having a Linux extension method for UnixDatagram that calls recv with MSG_PEEK | MSG_TRUNC, to block until the next packet is available and return the length of that packet. Perhaps next_packet_len()? (Doing that is possible on some other platforms via different methods, but some platforms can't do it at all without just reading and buffering the pending packet via MSG_PEEK with increasingly large buffers.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions