pub fn register(reg_type: &str, port: u16) -> Result<Registration>
Expand description
Register a service
reg_type
: the service type followed by the protocol, separated by a dot (for example, “_ssh._tcp”). For details seeDNSServiceRegister
port
: The port (in native byte order) on which the service accepts connections. Pass 0 for a “placeholder” service.handle
: the tokio event loop handle
Uses register_extended
with default RegisterData
.
See DNSServiceRegister
.
§Example
let mut registration = async_dnssd::register("_ssh._tcp", 22)?;
let result = registration.next().await.expect("no stream end")?;