Closed
Description
#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.)