Skip to main content

dns_port

Function dns_port 

Source
pub fn dns_port() -> u16
Expand description

Returns the DNS port number.

Returns the port that the DNS server is listening on, or 0 if the server has not been started yet.

§Returns

The port number (0-65535), or 0 if the server hasn’t started.

§Example

use Mist::dns_port;

let port = dns_port();
if port > 0 {
	println!("DNS server is running on port {}", port);
} else {
	println!("DNS server has not been started");
}