在WifiP2pDnsSdServiceInfo.newInstance可用的服务类型类型、WifiP2pDnsSdServiceInfo、newInstance

2023-09-06 23:08:37 作者:战骨踏为尘

我编程,使用无线上网直接的Andr​​oid应用程序。我想开始我的服务,我打电话WifiP2pDnsSdServiceInfo.newInstance。不过,我一直在寻找,我可以用不同的服务类型,而到目前为止,我只找到_ presence._tcp。

I'm programming an android application that uses Wifi Direct. I'm trying to start my service and I'm calling WifiP2pDnsSdServiceInfo.newInstance. However, I have been searching for the different service types that I could use, and so far I have only found "_presence._tcp".

我知道我应该以某种方式找到有道理什么我的应用程序试图完成一个业务类型。我可以只发明了吗?是否有协议的任何可用列表?

I understand that I should somehow find a service type that "makes sense" with what my application tries to accomplish. Can I just "invent" it? Is there any available list of protocols?

非常感谢!

推荐答案

Android的文档提供了一些信息,开始与指南的使用网络服务发现。根据它的服务类型的指定的协议和传输层的应用程序使用。语法是 _<协议> ._<传送层> 的。所以,你应该只使用现有的传输中的第二部分。最常用的是 TCP UDP ,当然。

Android documentation provides some info to start with in the guide Using Network Service Discovery. According it the service type specifies which protocol and transport layer the application uses. The syntax is _<protocol>._<transportlayer>. So you should only use existing transports in the second part. Most commonly used are tcp and udp, of course.

对于第一部分,有一堆应用级协议。例如, presence 是xmpp.org邮件协议,而 IPP 是打印机的服务。你可以找到的注册协议的更多或更少的完整列表在 dns-sd.org网站。你也可以看看服务名在iana.org 注册表。

As for the first part, there is a bunch of application level protocols. For example, presence is a messaging protocol from xmpp.org, and ipp is a printer service. You can find more or less complete list of the registered protocols at the dns-sd.org site. Also you may have a look at the service names registry at iana.org.

由于基于DNS的服务发现是零配置网络其中一部分有许多的实现,协议的附加名单可在特定供应商的网站上找到。例如,这里是苹果的Bonjour服务类型的。

As the DNS-based Service Discovery is a part of Zero-configuration networking which has numerous implementations, additional lists of protocols can be found on specific vendors sites. For example, here is the list of Apple's Bonjour service types.

我不认为存在的协议的全球使用的单一详尽的清单。不过,我想你可以用一个合理的distiguishable底层结构创造你自己的名字(首字母缩写词和/或语义) - 只需通过搜索互联网,并确保你的名字没有出现在有关零配置和DNS-SD

I don't think there exists a single exhaustive list of protocols used worldwide. Nevertheless, I suppose you could invent your own name with a reasonably distiguishable underlying structure (acronyms and/or semantics) - just search through the Internet and make sure your name does not appear in relation to Zeroconf and DNS-SD.