On Thu, Nov 04, 2004 at 12:58:09PM +0100, Simon Conrad-Armes wrote:
> 
> On Nov 4, 2004, at 11:33 AM, Michael Neumann wrote:
> 
> >On Thu, Nov 04, 2004 at 06:13:17PM +0900, Simon Conrad-Armes wrote:
> >>Has anybody started a Ruby BitTorrent transfer library? I wanted to
> >>start a RubyForge project for one but I hate duplicating the worthy
> >>efforts of others.
> >
> >Yep, it's me ;-)
> >
> >http://ntecs.de/viewcvs/viewcvs/BitTorrent/
> >
> >I've started with the client protocol, but that in a very ungood shape,
> >and is not yet commited.
> 
> That's cool tho. I figured someone out there must have gotten the same 
> idea :)
> Are you writing a full client or a library? From the code in repo it is 
> difficult to see.

My initial goal was to write a full client (but no tracker). But I
canceled it in favor of other more important things.

> >>I thought of starting off with a simple layer of glue around libbt
> >>(http://libbt.sf.net).
> >>Any thoughts, ideas?
> >
> >hm, why not write BT in pure Ruby?
> >
> 
> More work... But I suppose you are right. Coding RubyC for I/O-centric 
> stuff is an old habit based on performance superstition. From other 
> implementation in other than pure C, I have seen greatly varying 
> transfer rates... But you have the semi-working code. Have you noticed 
> any performance issues?

But the original BT was written in Python? I assume that there's no big
difference between Python and Ruby in performance (except that Python
has native threads).

Nope, I never got that far. Okay, I am able to read a .bittorrent
metainfo file, connect to a tracker and then finally connect to a peer
and communicate with it a bit. The peer protocol is not yet 100%
complete, but that should be very easy to do. The hard part is really
the application logic (managing the connections, choking, unchoking
etc.). If someone is interested to write this, then I would take the
time to finish the low-level peer protocol stuff.

Regards,

  Michael