[JDEV] File transfers
Fireglyph
fireglyph at gmx.net
Fri Jun 7 17:38:45 CDT 2002
On Friday 07 June 2002 22:11, Michael Rothwell wrote:
> [...] if a client is trying to transfter to another client on a
> different server, then the servers negotiate acceptable
> file-transfer parameters (the minimum of each server's config for
> file size, timeout, etc), and communicate limitations back to the
> client, including "server-assisted file transfer not supported," at
> which point the clients could fall back to p2p.
I really have difficulties to understand why anyone could prefer to
transmit a file two times by using a machine in the middle (with even
a higher payload if using Base64) instead of establishing a direct
binary p2p connection, sending it only one time over the wire - at
least if possible.
During the whole discussion I was often scratching my head, asking
myself why anyone should prefer the less efficient solution over the
other - especially if the same person doesn't only want to develop a
client, but even *use* it himself. (I've only a 56K modem, for
example.)
Therefore, shouldn't it rather read "p2p file transfer not supported"
(NATs, firewalls, etc.) - at which point I could fall back to p2s2p?
Why - for example - not inventing a handshaking protocol, in which
both clients exchange information about which one is sitting behind a
firewall. Let us assume that A wants to send a file to B.
IMO, the rule is simple:
IF (B can establish a connection to A) THEN
B connects to A and downloads the file using HTTP GET
(more efficient than uploading, see cable modems/ADSL)
ELSE IF (A can establish a connection to B) THEN
A connects to B and pushes the file using HTTP PUT/POST
ELSE
A connects to the server, uploads the file using HTTP PUT/POST
B connects to the server, downloads the file using HTTP GET
In each case, one would get the most efficient solution possible
given the circumstances - what's *wrong* with that???
I've to admit though that I can imagine some situations when using
the server could be a real advantage. If you want - for example - to
send the file to many people, maybe to a whole group in your roster
(or during a conference), then a server should be used to distribute
the file.
Otherwise, I'd always try the p2p solution.
(Two additional if-statements aren't *that* much difficult to
implement - are they?)
Of course, that's only my personal opinion,
greetings,
Marco
More information about the JDev
mailing list