mjansson / mdns

Public domain mDNS/DNS-SD library in C
The Unlicense
437 stars 117 forks source link

how can i add the TXT record like 'test=1'? #40

Closed ShiverZm closed 3 years ago

ShiverZm commented 3 years ago

i use your demo, it is cool, it can be searched by Bonjour,when i publish service. i want it work as MAC TV,so I need add some TXT record.

mjansson commented 3 years ago

You give the TXT record you want to send as last arguments to mdns_query_answer

I think the test program does this, iirc.

Or did you mean sending multiple TXT records in an answer? This is currently not supported, but something I can add.

ShiverZm commented 3 years ago

@mjansson yes,i want send multiple TXT record,i try do this by myself,but it did not work,would you mind adding this function?Thanks a lot.

mjansson commented 3 years ago

I will add a more generalized answer function that will also solve #39

mjansson commented 3 years ago

This has now been implemented, and the example code shows how to add multiple TXT records