> Honestly, looking at Old* vs new *, the only real differences I could see
> was that all the existing code was moved around.  I think a real rewrite
> might be in order.  

Before it was a single main function. Now it is broken down into
overridable functions so that it can be subclassed by other clients. Which
means I just moved code around. An area where significant work could be
done is in how the client handles messages that it receives. Structuring
of client message handling is on my TODO for when I have more time (i.e. 3
weeks, when I quit my job). My focus up to this point has been converting
the client classes into a reusable client library. Another pass could be
done on this, stripping out the CLI parts of the code into a separate
subclass for CLI clients. This code isn't useful on Mac clients, for
instance, which can't take command-line arguments, or Windows clients,
which just don't.

> * No need to have asynchronous behaviour in the cients.  Thats causing a
> lot of bugs or at least inconveniences.

Yes, asynchronous behaviour definitely makes things more complicated. I
don't know about there not being a need, however. You might want to be
requesting multiple things at once. Of course, the client could open up a
new connection in a new thread for each request. That's how I'd prefer to
do it, but I'm not sure if it's the best way.

> > * The code should be re-entrant.  It should be very straighforward to
>   listen for an additional message on an existing connection.  Currently
>   the clients are very 'one-shot' in nature.  

True. So you think that the connection should stay open and send more
messages instead of closing the connection and opening a new one for the
new message thread?



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

Reply via email to