How to publish file server service to local network?

依然范特西╮ 提交于 2019-12-06 06:09:56

问题


My question is about "automatic discovery of file server service on local network".

I want to implement a service which is file server basically and publish it on local network. Client PC which is connected to local network should find this service automatically and map (mount) network drive without user's intervention.

As I look through web shortly, I think "Bonjour" for Apple and "UPnP" for Windows is best option to implement this kind of feature.

Is this right assumption? Do you know any other good suggestion? How about Linux?

UPDATE: FYI - I finished my zero-configuration SW implementation on Linux by using Avahi for Mac OS X network and PnP-X for Windows network. You can find PnP-X sample codes at here. Also, see my another question for PnP-X.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/6935212/how-to-publish-file-server-service-to-local-network

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