Available service types in WifiP2pDnsSdServiceInfo.newInstance

限于喜欢 提交于 2019-12-19 04:15:16

问题


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?

Thanks a lot!


回答1:


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.

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.

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.

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.



来源:https://stackoverflow.com/questions/18176616/available-service-types-in-wifip2pdnssdserviceinfo-newinstance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!