Closed
Description
I can use peek
on a TCPStream to see how many bytes are available to read. I use this to avoid blocking when calling read
.
With UDPSocket, there doesn't seem to be a way to avoid blocking when using recv_from
to read data into a buffer. I want something that either reads a UDP packet or immediately returns. Does this exist?
EDIT: recv
and recv_from
seem to be exactly the same. recv
uses recv_from
in its example.