|
| Hi there,
Recently I asked for tips in preventing a client / server lockup.
Turns out if one deletes the FIFOs when the server is not running,
the client writes a request to the FIFO name, harmless, then reads
a reply from a non-existent filename: instant return with null string.
Cleanup and FIFO install done by the server (start|stop) script.
No client lockup, this client can recover:
function search_ip2country(a, i, j, k, m, n, o)
{
# entry: dotquad IP, returns cidr/nn:ccx or -:-- if not found
if (no_ip2c) return "-:-- "
if (client) { # perhaps use optional server
print a > ip2c_query
close(ip2c_query, "to")
getline o < ip2c_reply
close(ip2c_reply, "from")
if (!o) { # no server? go standalone mode
client = 0
printf "\nNo ip2c-server, "
read_ip2country()
return search_ip2country(a)
}
return o
}
.... [standalone search]
}
works for me ;)
Grant.
--
Cats are smarter than dogs. You can't make eight cats pull
a sled through the snow.
|
|