Function slimproto::discovery::discover

source ·
pub fn discover(timeout: Option<Duration>) -> Result<Option<Server>>
Expand description

Repeatedly send discover “pings” to the server with an optional timeout.

Returns:

  • Ok(None) on timeout
  • Ok(Some(Server)) on server response.
  • io::Error if an error occurs

Note that the Slim Protocol is IPv4 only. This function will try forever if no timeout is passed in which case Ok(None) can never be returned.