|
@@ -226,10 +226,13 @@ impl<H: Hal, T: Transport> VsockConnectionManager<H, T> {
|
|
|
Ok(bytes_read)
|
|
|
}
|
|
|
|
|
|
- /// Returns the number of bytes currently available in the recv buffer.
|
|
|
+ /// Returns the number of bytes in the receive buffer available to be read by `recv`.
|
|
|
+ ///
|
|
|
+ /// When the available bytes is 0, it indicates that the receive buffer is empty and does not
|
|
|
+ /// contain any data.
|
|
|
pub fn recv_buffer_available_bytes(&mut self, peer: VsockAddr, src_port: u32) -> Result<usize> {
|
|
|
let (_, connection) = get_connection(&mut self.connections, peer, src_port)?;
|
|
|
- Ok(connection.buffer.available())
|
|
|
+ Ok(connection.buffer.used())
|
|
|
}
|
|
|
|
|
|
/// Sends a credit update to the given peer.
|