Skip to content

Commit

Permalink
Explain the return value of poll().
Browse files Browse the repository at this point in the history
whitequark committed Oct 3, 2017
1 parent d88ef3c commit b0fc1d9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/iface/ethernet.rs
Original file line number Diff line number Diff line change
@@ -139,6 +139,17 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
/// That is, if `iface.poll(&mut sockets, 1000)` returns `Ok(Some(2000))`,
/// it harmless (but wastes energy) to call it 500 ms later, and potentially
/// harmful (impacting quality of service) to call it 1500 ms later.
///
/// # Errors
/// This method will routinely return errors in response to normal network
/// activity as well as certain boundary conditions such as buffer exhaustion.
/// These errors are provided as an aid for troubleshooting, and are meant
/// to be logged and ignored.
/// As a special case, `Err(Error::Unrecognized)` is returned in response to
/// packets containing any unsupported protocol, option, or form, which is
/// a very common occurrence and on a production system it should not even
/// be logged.
pub fn poll(&mut self, sockets: &mut SocketSet, timestamp: u64) -> Result<Option<u64>> {
self.socket_egress(sockets, timestamp)?;

0 comments on commit b0fc1d9

Please sign in to comment.