How to find/refresh local network SAMBA Shares on Leap 15.1 with C/C++

I am writing a c++ program on a Leap 15.1 (KDE) computer that accesses files on a SAMBA share in a local network. However, I’m finding that if the ip address lease expires the connection to the SAMBA share is lost.

If I type “smb://sharename” into the address bar of Dolphin, it causes the system to renew the ip address and my connection can be resumed.

My question is – what c or c++ functions can I call to provide the same outcome as Dolphin?

Thanks in advance.

Plerase no double posting. That will confuse contributers.

This one is CLOSEDand will be removed. Those interested please go to https://forums.opensuse.org/showthread.php/537174-How-to-find-refresh-local-network-SAMBA-Shares-on-Leap-15-1-with-C-C?p=2911458#post2911458