keepsimple1 / mdns-sd

Rust library for mDNS based Service Discovery
Apache License 2.0
96 stars 37 forks source link

example code: refactor the query output prints and the register hostname #189

Closed keepsimple1 closed 6 months ago

keepsimple1 commented 6 months ago

Now the query output is nicer to read:

$ cargo run --example query _printer._tcp 
<snip>
At 243.90251ms: Resolved a new service: Brother HL-L2390DW._printer._tcp.local.
 host: BRW485F99726515.local.
 port: 515
 Address: 192.168.0.111
 Address: fe80::4a5f:99ff:fe72:6515
 Property: txtvers=1
 Property: qtotal=1
 Property: pdl=application/octet-stream,image/urf,image/pwg-raster
 Property: rp=duerqxesz5090
 Property: note=
 Property: ty=Brother HL-L2390DW
 Property: product=(Brother HL-L2390DW)
 Property: adminurl=http://BRW485F99726515.local./
 Property: priority=50
 Property: usb_MFG=Brother
 Property: usb_MDL=HL-L2390DW
 Property: usb_CMD=PJL,HBP,URF
 Property: Color=F
 Property: Copies=T
 Property: Duplex=T
 Property: Fax=F
 Property: Scan=T
 Property: PaperCustom=T
 Property: Binary=T
 Property: Transparent=T
 Property: TBCP=F
 Property: UUID=e3248000-80ce-11db-8000-485f99726515