You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@matthewrobertbell we most definitely want to implement peek as it also exists in std::net::UdpSocket, but we've been blocked on the mio 0.7 release for this. Once it's released we'll upgrade, and implement the method accordingly.
I can use
peek
on a TCPStream to see how many bytes are available to read. I use this to avoid blocking when callingread
.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
andrecv_from
seem to be exactly the same.recv
usesrecv_from
in its example.The text was updated successfully, but these errors were encountered: