[Twisted-Python] suggestion for a file transfer protocol

David Ripton dripton at ripton.net
Tue May 11 09:17:51 MDT 2010


On 2010.05.11 12:20:27 +0200, Gabriele Lanaro wrote:
> I'm trying to develop a simple application that let communicate two
> computers in a LAN for transferring files. My idea is that:
> 
> using dbus/zeroconf each machine can see other's service and can connect
> with it (I need something without authentication or so)

It's a good concept, as long as all machines are on the same subnet and
they all have a zeroconf client installed.

I've had very bad experience with the old version of dbus-python that
ships with RHEL 5.  It just doesn't work reliably.  But if you're on a
more modern distrobution with newer versions of everything, maybe it'll
all work great.

> having a lan with 2 machines
> 
> A asks B if he can send a file
> 
> if B accepts, begin transferring
> if B refuse, send an error back
> 
> It would be nice to transfer big files (not loaded all in memory) and the
> ability to stop/resume the upload/download and the integrity check.
> 
> Is there a protocol that let me do this stuff or is better to implement a
> protocol on my own? (I'd like that the system is flexible to further extend
> for example, implement shared folders and so on)

If a pre-built program like scp or rsync doesn't do exactly what you
want, and you want the ability to extend it later, then I think it's
reasonable to do your own protocol.

> In the latter case it's convenient to use one port or two ports like ftp
> does?

I prefer to only use one port if possible, because it's simpler.  And it
simplifies dealing with firewalls, if you ever have to do that.  As long
as you split large files into reasonably small chunks so the data
packets don't cause excessive latency for the control packets, it should
work fine.

-- 
David Ripton    dripton at ripton.net




More information about the Twisted-Python mailing list