pub fn register(reg_type: &str, port: u16) -> Result<Register>
Expand description

Register a service

  • reg_type: the service type followed by the protocol, separated by a dot (for example, “_ssh._tcp”). For details see DNSServiceRegister
  • 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 registration = register("_ssh._tcp", 22)?.await?;