Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

75 lines (56 sloc) 2.162 kb
NAME
Net::BitTorrent - BitTorrent peer-to-peer protocol
SYNOPSIS
use Net::BitTorrent;
sub hash_pass {
my ($self, $piece) = @_;
printf(qq[on_hash_pass: piece number %04d of %s\n], $piece->index,
$piece->session);
}
my $client = Net::BitTorrent->new();
$client->set_callback_on_piece_hash_pass(\&hash_pass);
# ...
# set various callbacks if you so desire
# ...
my $torrent = $client->add_session({path => q[a.legal.torrent]})
or die q[Cannot load .torrent];
while (1) {
$client->do_one_loop();
# Etc.
}
DESCRIPTION
This module provides a basic implementation of the current BitTorrent
protocol. Each "Net::BitTorrent" object is a full client capable of
handling several concurrent torrent sessions.
INSTALLATION
The current distribution uses the CORE "ExtUtils::MakeMaker" module,
so the standard procedure will suffice:
perl Makefile.PL
make
make test
make install
If you would like to contribute automated test reports (and I hope
you do), first install "CPAN::Reporter" from the CPAN shell and then
install "Net::BitTorrent":
$ cpan
cpan> install CPAN::Reporter
cpan> reload cpan
cpan> o conf init test_report
[...follow the CPAN::Reporter setup prompts...]
cpan> o conf commit
cpan> install Net::BitTorrent
For more on becoming a CPAN tester and why this is useful, please see
the "CPAN::Reporter" documentation, <http://cpantesters.perl.org/>,
and the CPAN Testers Wiki (http://cpantest.grango.org/).
AUTHOR
Sanko Robinson
CPAN ID: SANKO
<sanko@cpan.org>
LICENSE AND LEGAL
Copyright 2008 by Sanko Robinson <sanko@cpan.org>
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html> or the LICENSE file
included with this module.
Neither this module nor the "AUTHOR" is affiliated with BitTorrent,
Inc.
Jump to Line
Something went wrong with that request. Please try again.