> Er, I don't think you have thought this through (or maybe I haven't!). 
> If you are writing to the file at the same time as streaming it to the
> next node, then by the time you have finished writing to the file, you
> will have finished streaming the data too!
> 
> Ian.

Correct me if i'm wrong, but the cause of the delay is the other node taking
longer to stream then it would to just stream to localhost. If we streamed
to the other node as time/bandwidth allowed, while (in parallel) streamed to
the local (or target, if inserting into a remote node) file as fast as data
could be sent by the client. Then, once the client was done streaming, it could
disconnect, and go on its merry way, while the node that accepted the insertion
from the client could reopen the inserted file from the datastore and continue
streaming where it left off.

Ex:

The players: Node1, Node2, Client

Client Connects to Node1.

Client tells node1 it is inserting data and waits.

Node1 sends off its DataRequest and waits.

Node1 gets back "Not found" or whatever the message name is and
allows the insertion.

Node1 allocates a buffer for Node2 to stream from and tracks the position in
the data stream that has thus far been appended to the buffer. The buffer is
streamed to Node2 as fast as is appropriate.

Incoming data is appended to the buffer (until the buffer fills up), and is
also written to the local datastore.

After the write is finished, the local copy of the file is reopened and 
streamed to Node2 as whatever rate it accepts. The client may safely disconnect
at this point.

NOTES: 

This won't have an impact on streaming performance with high bandwidth
connections, as they were accepting the stream as fast as the client could
send anyway. For nodes with lower bandwidth neighbors, this will avoid the
client having to wait on them to finish streaming.

Tell me if this is flawed :-)

Regards,

Adam Lydick

-- 
Freenet -- Re-Wiring the Internet
http://freenet.sourceforge.net
My Node: tcp/rivendell.yi.org:19114

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

Reply via email to