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?
I’m not a programmer, but the gethostbyname function can be used to resolve hostnames using the name resolution protocols defined in /etc/nsswitch.conf…
gethostbyname() is where I started, but it doesn’t work in this scenario.
The code is to run on a Leap15.1 workstation, the server (also Linux) managers the DNS, the SAMBA share is on a NAS (on the same local network). There are also various Windows workstations on this local network - they work okay in this scenario.
The problem seems to be that the server doesn’t automatically renew the ip address of the NAS when the lease expires. I don’t have access to the server to alter its behaviour.
The Windows workstations (through drive mapping) somehow trigger the server to renew the NAS ip address lease, as does Dolphin on the Leap15.1…