0.Part2: Bonjour and Avahi implemented by mDNS (2)——win/linux/arm cross compilation q=Bonjour %20SDK%20for%20WindowsBonjour-winBonjour... https://blog.csdn.net/qq_23958061/article/details/122092864?spm=1001.2014.3001.5502
1.Windows
Hello - Apple Developer https://developer.apple.com/hello/
Bonjour SDK for Windowshttps://developer.apple.com/download/all/?q=Bonjour%20SDK%20for%20Windows
Download the above official website sdk, install it (the Bonjour service starts, depends on the mDNSResponder.exe process), and C# can be used by adding COM components in the project.
Source code reference (C# reference DNSServiceBrowser.NET project):
Source Codehttps://opensource.apple.com/tarballs/mDNSResponder/
Source directory analysis can refer to other articles:
2. Linux and ARM cross compilation and deployment
For linux, refer to the following article: [Embedded project from 0 to 1] LAN automatic discovery function, Apple Bonjour/mdnsResponder porting_SevenFighting's column-CSDN blog Communication in the LAN, you must know the IP address and port of the other party, Apple's open source mdnsResponder is a way to use the mdns multicast protocol to obtain the corresponding ip address through the service domain name. For example, we have a camera. In the case of networking, the app under the same LAN wants to discover the camera and establish a connection with the camera. Such a requirement requires the camera to call mDNS_Register, pass parameters to inform the mdns library, and register a did._ipcxx._tcp on the specified port.... https://blog.csdn.net/bingyu880101/article/details/81563319 As for ARM cross-compilation, the premise is that you have an ARM platform cross-compilation toolchain (may be a bit nonsense), and the part that needs to be modified is our mDNSRespon For the Makefile under mDNSPosix under der-878.70.2 (according to the downloaded source code version), the modifications to be made are as follows (delete two CFLAGS_OS, specify CC, specify STRIP):
Deployment on ARM (actually refer to the install command of the Makefile):
① Copy the executable file "mdnsd" of mDNSPosix/build/prod to the "/usr/sbin" directory of the embedded ARM platform board;
② Copy libdns_sd.so and libnss_mdns-0.2.so under mDNSPosix/build/prod directly to the "/usr/lib/" directory;
③ Copy the dns-sd under Clients/build to the appropriate directory;
Usage on ARM (via the dns-sd executable):
①First start mdnsd as a daemon (it can be automatically started by adding ln -s to init.d);
② When the application needs, start dns-sd with parameters, such as "./dns-sd -R hxx _lvds local 8888 172.100.19.251", as shown in the figure below (the mdns service on arm is found on win)
3. Extra (Avahi)
For the special mDNS library on linux (does not support windows), you can refer to it (actually bloggers use this kind of implementation on ARM, and bonjour on win, the two are compatible , the above compilation and deployment of bonjour on arm are just some attempts):
http://www.avahi.org/ http://www.avahi.org/ Compared with Bonjour's implementation, Avahi says this on Wikipedia:
=======================================
Avahi vs. Hello[ edit ]
The Avahi project started in 2004 because Apple's Zeroconf implementation, Bonjour, used the GPL-incompatible Apple Public Source License. In 2006 Apple relicensed parts of Bonjour under the Apache License.[2]
Avahi's performance resembles that of Bonjour, sometimes exceeding it; however Avahi can lose services when managing large numbers of requests simultaneously.[3]
========================================
The Avahi project started in 2004 because Apple 's implementation of Zeroconf, Bonjour, used the Apple Public Source License, which is not compatible with the GPL . In 2006, Apple relicensed parts of Bonjour under the Apache license . [2]
Avahi performs similarly to Bonjour and sometimes even exceeds it; however, Avahi can lose service when managing a large number of requests simultaneously. [3]