On Sun, Aug 20, 2000 at 08:37:15PM -0500, MJR wrote:
> Hi Oskar,
> 
> >From what I've seen the clients currently return 0 regardless of the
> outcome of the request/insert. Would you mind making them return
> non-zero if the request/insert fails? A set of meaningful return codes
> would *really* help - i.e., 1 = key already exists, 2 = timed out , etc.
> 
> I ask because I've been hacking a GTK+ wrapper for the new CLI clients,
> and short of trapping and interpreting all the output (hard with
> multiple threads) there's really no way to find out what went wrong.
> Inserts are particularly nasty, because there's no file saved to check
> for.

Unfortunately this seems harder said then done in java. If somebody knows
a good way to do it I would be very interested.

(Note: I am well aware of the System.exit(int) method, but the clients are
multithreaded, so I don't want to finish "now" I want something like
System.setExitStat(int) so that it returns that exit status when it exits
normally because all the threads have ended. Otherise I'll have to do
something like:

        Thread[] ts; int count;
        do {
            CurrentThread.yield();
            count = 0;
            ts = new Thread[Thread.activeCount()];
            int n = Thread.enumerate(ts);
            for (int i = 0; i < n ; i++) {
                if (!ts[i].isDaemon())
                    count++;
            }
        } while (count > 1);
        System.getRuntime().exit(exitStatus);

which is a little kludgy).


> Mark Roberts
> mroberts100 at mediaone.net
> 
> _______________________________________________
> Freenet-dev mailing list
> Freenet-dev at lists.sourceforge.net
> http://lists.sourceforge.net/mailman/listinfo/freenet-dev
> 

-- 
\oskar

_______________________________________________
Freenet-dev mailing list
Freenet-dev at lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/freenet-dev

Reply via email to