How to publish file server service to local network?

荒凉一梦 提交于 2019-12-04 09:50:47

Bonjour (mDNS) is a good solution and there are stable libraries for Mac, Windows and Linux.

  1. OS X- Check out the documentation for NSNetService
  2. Windows- I'd use the Apple Bonjour SDK for Windows or the jMDNS library if you're developing a Java app.
  3. Linux- The Avahi APIs are probably the easiest to integrate.

Apple has open-sourced its reference mDNS implementation and getting it to compile on most platforms is pretty trivial. There are also wrappers for many scripting languages, for example Net::MDNS for ruby.

I think what you are looking for is Zero configuration networking, it is a technical specification that is not bound to any vendor. Bonjour from Apple and UPnP SSDP from Microsoft are different implementation of Zero configuration networking. Generally speaking, it allows you announce/discovery network service with zero network configuration. If you are with Java, there are already some frameworks that makes your life easier JmDNS and Cling.

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