Skip to content

Commit b0fc1d9

Browse files
committedOct 3, 2017
Explain the return value of poll().
1 parent d88ef3c commit b0fc1d9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

Diff for: ‎src/iface/ethernet.rs

+11
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
139139
/// That is, if `iface.poll(&mut sockets, 1000)` returns `Ok(Some(2000))`,
140140
/// it harmless (but wastes energy) to call it 500 ms later, and potentially
141141
/// harmful (impacting quality of service) to call it 1500 ms later.
142+
///
143+
/// # Errors
144+
/// This method will routinely return errors in response to normal network
145+
/// activity as well as certain boundary conditions such as buffer exhaustion.
146+
/// These errors are provided as an aid for troubleshooting, and are meant
147+
/// to be logged and ignored.
148+
149+
/// As a special case, `Err(Error::Unrecognized)` is returned in response to
150+
/// packets containing any unsupported protocol, option, or form, which is
151+
/// a very common occurrence and on a production system it should not even
152+
/// be logged.
142153
pub fn poll(&mut self, sockets: &mut SocketSet, timestamp: u64) -> Result<Option<u64>> {
143154
self.socket_egress(sockets, timestamp)?;
144155

0 commit comments

Comments
 (0)
Please sign in to comment.