Re: [Freenet-dev] Signalling end of data insertion.....I too feel that the
building a full fledged GUI on top of the existing structure is going to be
some workarounds like u have in Freeloader.
I would like a lot to work on this thing for a better model which would
facilitate better GUI integration to the core, but bloody hell my work gets
in the way.
My code is still miles away at the pace at which im swapping all i could
manage after i put out that dumb interface change was cleanely splitting it
out into 2 and i've not got time yet, well will post the developements i
have and meanwhile watching the things going on........


jebu
----- Original Message -----
From: Paul Kappler
To: freenet-dev at lists.sourceforge.net
Sent: Tuesday, April 18, 2000 1:47 PM
Subject: Re: [Freenet-dev] Signalling end of data insertion.....


Freeloader uses the ByteCounterInputStream concept to do this.  It is not a
perfect solution but it works.  You can watch the bytes counted until the
whole file has been read.  At this point you know it's done.  This happens
in both the ProgressBar and insert file button in the MainFrame.

Maybe GUI's need a slight different ConnectionHandler model then the server
is using, or maybe we need to change the current model.  Maybe a synchronous
model with progress events would be a better solution.  I know I don't like
having having all of the critical sections all over the code for handling
conduits.

I struggled with looking for a better way as well, I did not find one in the
current model.  Maybe after we all see your code a better way will better
way will become clear.  This project is in constant evolution.



Paul


From: "Jebu Ittiachen" <[email protected]>
Reply-To: freenet-dev at lists.sourceforge.net
Date: Mon, 17 Apr 2000 21:22:32 -0500
To: <freenet-dev at lists.sourceforge.net>
Subject: [Freenet-dev] Signalling end of data insertion.....



Hi,
   I was looking around the code for finding some place to trigger the GUI a
signal that the insert request has been completed, like in the case of a
data request where a conduit is started off by the SimpleRequestClient in
case of FGUI and gets calledback. However in the case of a message which has
a payload like the Insert message the ConnectionHandlers sendMessage() has
something of this sort

<code-snip_from_ConnectionHandler.java>
    InputStream data = raw.getTrailing();
    if (data != null) {
 ConnectionCB ccb;
 if (!raw.isKeepAlive())
     ccb = new ConnectionCB();
 else
     ccb = null;
 (new Conduit(data, c.out)).asyncFeed(ccb, null, raw.trailingFieldLength());
    } else if (!raw.isKeepAlive()) {
 this.close();
</code-snip_from_ConnectionHandler.java>

Should the invoking agent have more control over the way this conduit
functions? shud the invoking agent have some way of being called back by the
coduit rather than having the signal of a end of input come from inside the
counter class?
Situations like a network fault where the connection breaks off between an
insert or request the Conduit calls the interrupted callback and in case of
a insert the invoker gets no signal of this. However in case of the key
request since the async feed is started by the invoker the callbacks are
handy.......
any lights on this???

jebu

_____________________________________________
NetZero - Defenders of the Free World
Click here for FREE Internet Access and Email
http://www.netzero.net/download/index.html

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

Reply via email to