A waste disposal system

A more complex arrangement would be to time how long the server instance has been out of the pool and in use and measure this time against an “I-am-worried” time. When the pool manager starts getting worried about the time, it starts looking to see whether the client is still out there. You can look for the client by using API network calls in Visual Basic 4, but since you cannot use callbacks and thus enumerated API calls, you have to write a little C DLL to do this. In Visual Basic 5, you can exploit the new capability to use callbacks. Obviously, the client then has to provide the pool manager with its machine ID. If the client exists, the pool manager has to take the view that the object instance is still required by that client. If the pool manager doesn’t find the client, however, or if we’ve now had the instance booked out so long that it has reached a “This-can’t-go-on” time, the pool manager might figure that something is wrong. When the pool manager decides this, it believes that the object instance isn’t coming back anymore, so it takes action to clear out the dead/redundant object (using the previously stored process ID of the server instance, for example, to kill the process). The code for this example is in CHAP02\Listings\Listings.vbp (Kill.Bas) on the companion CD.