Hot take, #P2P protocols shouldn't use MDNS for peer discovery if they don't plan to use the OS provided APIs for it. Only one process can reliably bind the UDP port necessary for it and it quickly leads to conflicts. At the very least you should use a custom port to avoid conflicting with the OS.
@T_X I doubt the os impl would be all that different from libraries. Mdns is a pretty straightforward spec. The main thing to be weary of is conflicts with the OS since only one socket can bind to a given port for multicast udp. Meant that macos was very unreliable when software chose to bundle it's own