[][src]Function domain_resolv::lookup::srv::lookup_srv

pub fn lookup_srv<R, S, N>(
    resolver: R,
    service: S,
    name: N,
    fallback_port: u16
) -> LookupSrv<R, S, N> where
    R: Resolver,
    S: ToRelativeDname + Clone + Send + 'static,
    N: ToDname + Send + 'static, 

Creates a future that looks up SRV records.

The future will use the resolver given in resolver to query the DNS for SRV records associated with domain name name and service service.

The value returned upon success can be turned into a stream of ResolvedSrvItems corresponding to the found SRV records, ordered as per the usage rules defined in [RFC 2782]. If no matching SRV record is found, A/AAAA queries on the bare domain name name will be attempted, yielding a single element upon success using the port given by fallback_port, typcially the standard port for the service in question.

Each item in the stream can be turned into an iterator over socket addresses as accepted by, for instance, TcpStream::connect.

The future resolves to None whenever the request service is “decidedly not available” at the requested domain, that is there is a single SRV record with the root label as its target.