Instead of giving Kodi a network path to follow you can at the operating system level make a “mount point” (somewhat like a special folder) that connects to a network share. Thus pointing Kodi to there it is just accessing a local resource and the operating system is taking care of the networking part, which it may be able to do a better job of. See this how-to on how you can make one using autofs…