gpt4 book ai didi

c - bonjour 如何发现网络上的设备?

转载 作者:太空狗 更新时间:2023-10-29 16:41:39 24 4
gpt4 key购买 nike

我想写一个可以搜索Bonjour的C程序网络上启用的设备。

基本上我们有一个网络摄像机,它支持 Bonjour 协议(protocol)。我想用 C 编写 API,可以搜索这些启用了 Bonjour 的设备。有没有人有关于我应该如何做的示例代码或建议?

最佳答案

根据您的要求,以下链接提供了一些代码示例:

mDNSResponder

引自 mDNSPosix/ReadMe.txt:

mDNSPosix is a port of Apple's Multicast DNS and DNS Service Discovery code to Posix platforms.

Multicast DNS and DNS Service Discovery are technologies that allow you to register IP-based services and browse the network for those services.

Packing List:

The sample uses the following directories:

o mDNSCore -- A directory containing the core mDNS code. This code
is written in pure ANSI C and has proved to be very portable. Every platform needs this core protocol engine code.

o mDNSShared -- A directory containing useful code that's not core to the main protocol engine itself, but nonetheless useful, and used by
more than one (but not necessarily all) platforms.

o mDNSPosix -- The files that are specific to Posix platforms: Linux, Solaris, FreeBSD, NetBSD, OpenBSD, etc. This code will also work on
OS X, though that's not its primary purpose.

o Clients -- Example client code showing how to use the API to the
services provided by the daemon.

Using the Sample ---------------- When you compile, you will get:

o Main products for general-purpose use (e.g. on a desktop computer): - mdnsd - libmdns - nss_mdns (See nss_ReadMe.txt for important information about nss_mdns)

o Standalone products for dedicated devices (printer, network camera, etc.) - mDNSClientPosix - mDNSResponderPosix - mDNSProxyResponderPosix

o Testing and Debugging tools - dns-sd command-line tool (from the "Clients" folder) - mDNSNetMonitor - mDNSIdentify

SDWrap

ReadMe:

Quite simple wrapper app to execute some command with Zeroconf supplied addresses and ports. Uses wxWidgets and wxServDisc for service discovery...

祝你好运!

关于c - bonjour 如何发现网络上的设备?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9002484/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com