ping

Function new_unicast_sink_and_stream

Source
pub fn new_unicast_sink_and_stream<'a, I, S, const N: usize>(
    socket: &'a S,
    addr: &'a I::SockAddr,
    body: &'a [u8],
) -> (impl Sink<u16, Error = PingError> + 'a, impl Stream<Item = Result<u16, PingError>> + 'a)
where I: IpExt, S: IcmpSocket<I>,
Expand description

Create a ping sink and stream for pinging a unicast destination with the same body for every packet.

Echo replies received with a source address not equal to addr will be silently dropped. Echo replies with a body not equal to body will result in an error on the stream.