除了 JMDNS 之外,还有其他用于 bonjour/zeroconf 的 Java 库吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1233204/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 01:11:03  来源:igfitidea点击:

Are there any other Java libraries for bonjour/zeroconf apart from JMDNS?

javabonjourzeroconf

提问by Mauli

Are there any other Java libraries for bonjour/zeroconf apart from JMDNS?

除了 JMDNS 之外,还有其他用于 bonjour/zeroconf 的 Java 库吗?

回答by xdevel2000

Try at:

尝试:

DNS-SD

域名解析

-- The same Java DNS-SD APIs are also available in Bonjour for Windows, Bonjour for Linux, Solaris, *BSD, etc., enabling Java software to make use of Zeroconf's DNS Service Discovery across a wide range of platforms, not just on Mac OS X ......

-- 同样的 Java DNS-SD API 也可用于 Bonjour for Windows、Bonjour for Linux、Solaris、*BSD 等,使 Java 软件能够在广泛的平台上使用 Zeroconf 的 DNS 服务发现,而不仅仅是在Mac OS X ......

回答by Dougnukem

I'm also curious to find the best cross-platform DNS-SD (Zeroconf, Bonjour, DNS self discovery) library exists out there.

我也很想找到最好的跨平台 DNS-SD(Zeroconf、Bonjour、DNS 自我发现)库。

It does sound like Apple's DNS-SD dnssd.jaris the "official" Java library that requires native library support on Windows, Linux, etc, but works out of the box on Mac OSX.

听起来确实像Apple 的 DNS-SD dnssd.jar是“官方”Java 库,它需要 Windows、Linux 等上的本机库支持,但在 Mac OSX 上开箱即用。

There are other pure Java DNS-SD implementations, but it's unclear if any of them offer a library that is as easy to use or fully tested as DNS-SD (some of the projects appear to be abandoned for 2 years).

还有其他纯 Java DNS-SD 实现,但不清楚它们中是否有任何一个提供与 DNS-SD 一样易于使用或经过全面测试的库(有些项目似乎被放弃了 2 年)。

  1. Official Apple DNS-SD mDNSResponder library
  2. mDNSResponder and jmDNS integration- There's been some work to create a library that provides a common DNS-SD interface to jmDNS and Apple's mDNSResponder implementation. Instructions to use the jmDNS wrapper.
  3. waiter- Described as a "modern DNS library and an effective DNS-SD (Service Discovery) library." It utilizes java NIO networking.
  4. jmDNS- JmDNS provides easy-to-use pure-Java mDNS implementation that runs on JDK 1.4 and higher
  5. JiveDNS- "JiveDNS is a fork of the defunct JmDNS library, used for multicast DNS service discovery and registration." (it itself has not seen an SVN update in over 2 years)
  1. 官方 Apple DNS-SD mDNSResponder 库
  2. mDNSResponder 和 jmDNS 集成- 已经做了一些工作来创建一个库,该库为 jmDNS 和 Apple 的 mDNSResponder 实现提供公共 DNS-SD 接口。使用 jmDNS 包装器的说明
  3. 服务员- 被描述为“现代 DNS 库和有效的 DNS-SD(服务发现)库”。它利用 java NIO 网络。
  4. jmDNS- JmDNS 提供易于使用的纯 Java mDNS 实现,可在 JDK 1.4 及更高版本上运行
  5. JiveDNS- “JiveDNS 是已失效的 JmDNS 库的一个分支,用于多播 DNS 服务发现和注册。” (它本身已经超过 2 年没有看到 SVN 更新了)

回答by MandoMando

Waiter seems to be a pure Java library for DNS-SD. It's available here:

Waiter 似乎是 DNS-SD 的纯 Java 库。它可以在这里找到:

http://code.google.com/p/waiter/

http://code.google.com/p/waiter/

回答by Charlie

Unless your goal is to announce service availability to other mDNS compatible applications or to consume mDNS services from other applications, it might make more sense to implement your own broadcast-based service discovery.

除非您的目标是向其他 mDNS 兼容应用程序宣布服务可用性或使用来自其他应用程序的 mDNS 服务,否则实现您自己的基于广播的服务发现可能更有意义。

回答by carl

dns_sd.jar on windows works fine, download from Apple (SDK for windows). Beware of reinstallations of Bonjour because they tend to overwrite the Program Files/Bonjour directory containing the dns_sd.jar. Airfoil from Rogue Amoeba is one example on this, however they claim to use the Apple original installer.

Windows 上的 dns_sd.jar 工作正常,从 Apple 下载(适用于 Windows 的 SDK)。当心重新安装 Bonjour,因为它们往往会覆盖包含 dns_sd.jar 的 Program Files/Bonjour 目录。来自 Rogue Amoeba 的 Airfoil 就是一个例子,但他们声称使用的是 Apple 原始安装程序。

dnssd.jar on OSX works fine, but is no longer included in the latest Java releases as Oracle has taken over responsibility. However, the file is still on the disk since the 1.6 Java of Apple is on the disk. Just find the file and move it to /externals folder in your latest Java. So it is quite funny-idiotic that Apple provides a well functioning SDK for Windows implementation of Java DNS SD, while not offering anything at all for their own OSX. I anticipate that this is simply the result of hating Java too much over at Apple?

OSX 上的 dnssd.jar 工作正常,但不再包含在最新的 Java 版本中,因为 Oracle 已经接管了责任。但是,该文件仍在磁盘上,因为 Apple 的 1.6 Java 在磁盘上。只需找到该文件并将其移动到最新 Java 中的 /externals 文件夹即可。因此,Apple 为 Java DNS SD 的 Windows 实现提供了一个功能良好的 SDK,而对他们自己的 OSX 根本没有提供任何东西,这是非常有趣的愚蠢的。我预计这仅仅是因为 Apple 太讨厌 Java 的结果?

But, does anyone know of a Java implementation of the airtunes protocol; the latest version used in today′s Airport Express and Apple TV, being NOT the same version as used in earlier models of Airport Express ?

但是,有人知道 airtunes 协议的 Java 实现吗?今天的机场快线和 Apple TV 中使用的最新版本,与早期机场快线型号中使用的版本不同?

I know of qTunes, but it does not work with latest Airtunes versions. (I could get it to work with Rogue Amoeba′s Airfoil speakers for Mac OS X)

我知道 qTunes,但它不适用于最新的 Airtunes 版本。(我可以让它与适用于 Mac OS X 的 Rogue Amoeba 的 Airfoil 扬声器配合使用)

I am not monitoring this thread, but can be contacted at [email protected] for practical questions.

我不监视此线程,但可以通过 [email protected] 联系以解决实际问题。

回答by posicks

mdnsjava is a project that provides mDNS and DNS-SD support for dnsjava (dnsjava.org). Unlike many of the DNS-SD java implementations mdnsjava supports full mDNS DNS RR resolution, not just the resolution of services.

mdnsjava 是一个为 dnsjava (dnsjava.org) 提供 mDNS 和 DNS-SD 支持的项目。与许多 DNS-SD java 实现不同,mdnsjava 支持完整的 mDNS DNS RR 解析,而不仅仅是服务解析。

https://code.google.com/p/mdnsjava/

https://code.google.com/p/mdnsjava/

回答by Todd K

I've been working on a simple, pure Java implementation of mDNS Service Discovery. At the moment only synchronous browsing is supported, but I plan to add an asynchronous listener in the next release. It's free software and available on GitHub at https://github.com/fflewddur/hola.

我一直在研究 mDNS 服务发现的简单、纯 Java 实现。目前仅支持同步浏览,但我计划在下一个版本中添加一个异步侦听器。它是免费软件,可在 GitHub 上获取,网址https://github.com/fflewddur/hola

The only requirements are Java 8 and having the slf4j-apiavailable in your class path.

唯一的要求是 Java 8 并在您的类路径中提供slf4j-api

回答by 4ntoine

I've found more easy to create my own implementation (after experience with WS-Discovery and Bonjour for cross-platform cases) https://github.com/4ntoine/ServiceDiscovery-java. It has both Java and iOS impl for both client and server side.

我发现创建自己的实现更容易(在使用 WS-Discovery 和 Bonjour 进行跨平台案例之后)https://github.com/4ntoine/ServiceDiscovery-java。它具有客户端和服务器端的 Java 和 iOS impl。

回答by nathan1138

Try avahi4j (https://code.google.com/archive/p/avahi4j/). But the project is archived and there is no active development from 2009.

尝试 avahi4j ( https://code.google.com/archive/p/avahi4j/)。但该项目已存档,并且从 2009 年开始没有积极的开发。