Microsoft KB Archive/35860
SHARE Unusable when a Network Node Crashes ID Number: Q35860
3.x 4.00 MS-DOS
We are writing a multiuser product that runs under MS-DOS on a network environment. File locking is implemented using the MS-DOS SHARE command. Our customers have found, however, that if one of the nodes on the network crashes, the DOS SHARE table is not cleared, meaning that files/records are locked. Is there any way to clear the MS-DOS SHARE table WITHOUT bringing down the entire network and rebooting the server machine?
Networks are supposed to have “keep alives.” When a node crashes, the server is told that the keep alive has died and the connection is gone. At this point, the server cleans up after it. There is often a time delay involved here, but it shouldn’t be any longer than ten seconds. Some less-than-robust networks don’t have this service, and thus this “automatic” cleanup is impossible.
The IBM PC NET and Microsoft MS NET servers have a submenu on the server services screen that lets you close an open file. If you close an open file that is locked, all of the stations that are hooked up to this file will receive invalid handle errors. To correct this problem, these workstations merely have to close their current handle, then reopen it. This is one of the things the NET FILE command does. Later versions of the Microsoft MS NET Server may add the ability to invalidate only those file opens for a particular connection. This is a better way of getting around a crashed workstation than rebooting the server. Consult your network server documentation for more information on this.
Unfortunately, there is no way to perform this service from a remote workstation, nor is there a system call or API for performing this on the server in an application. The only way in which this service can be obtained is from the network server software.