NAME
Net::BitTorrent::Session::Piece - Single piece
Constructor
new ( { [ARGS] } )
-
Creates a
Net::BitTorrent::Session::Piece
object. This constructor should not be used directly.
Methods
as_string ( [ VERBOSE ] )
-
Returns a 'ready to print' dump of the
Net::BitTorrent::Session::Piece
object's data structure. If called in void context, the structure is printed toSTDERR
.See also: Net::BitTorrent
get_blocks ( )
-
Returns a hash of key/value pairs for each Net::BitTorrent::Session::Piece::Block object related to this piece. The keys of this hash are offsets.
If this piece is not marked working,
undef
is the return value. get_hash ( )
-
Returns the 20-byte SHA1 hash used to verify the contents of this piece.
See also: get_verified_integrity ( )
get_cached_integrity ( )
-
Returns a cached boolean value indicating whether or not this piece passes hash checking. This value is cached to save time; to be sure that this value is accurate, use get_verified_integrity ( ).
get_verified_integrity ( )
-
Verifies data integrity of this piece by checking against the SHA1 hash.
See also: get_cached_integrity ( ), get_hash ( )
get_client ( )
-
Returns the Net::BitTorrent object related to this file.
get_index ( )
-
Returns the zero based index of this piece according to the related Net::BitTorrent::Session object.
get_priority ( )
-
Get the download priority of this piece.
See also: Net::BitTorrent::Session::File
set_priority ( [NEWVAL] )
-
Set the download priority of this piece.
By default, all pieces begin with a priority of two (
2
).See also: Net::BitTorrent::Session::File
get_session ( )
-
Returns the Net::BitTorrent::Session object related to this file.
get_size ( )
-
Returns the size of the piece represented by this object.
get_working ( )
-
Returns a boolean value indicating whether or not we are actively requesting blocks from this piece.
set_working ( NEWVAL )
-
Sets a boolean value indicating whether or not we are actively requesting blocks from this piece.
NOTE: This is an advanced function that should not be used under normal conditions.
Author
Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
CPAN ID: SANKO
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 5.10 (or higher). See http://www.perl.com/perl/misc/Artistic.html or the LICENSE file included with this distribution.
All POD documentation is covered by the Creative Commons Attribution- Noncommercial-Share Alike 3.0 License (http://creativecommons.org/licenses/by-nc-sa/3.0/us/).
Neither this module nor the Author is affiliated with BitTorrent, Inc.