Skip to main content

probe

Function probe 

Source
pub fn probe(
    port: u16,
    method: &str,
    path: &str,
    timeout: Duration,
) -> Option<(u16, String)>
Expand description

Ask a server on 127.0.0.1:port for path, returning its status code and body.

None means nothing accepted a connection. A status of 0 means something answered but not in HTTP this could read, which still says something is there. timeout bounds the connection and each read and write separately, not the call as a whole.