Search code examples
cocoamacosmacos-carbon

How to check whether a server is available for mounting a folder/drive on local netwok?


I would like to check whether a server is available or not on the local network. I can connect connect to shared folders with FSMountServerVolumeAsync, but I would like to check their availability before, otherwise OS pops up a message if the server is unavailable.


Solution

  • I guess there are many ways to do so.

    One solution would be to simply try creating a connection using NSURLConnection. If it fails (there is a delegate) you know that you don't even have to try to mount it...