NAME

Net::BitTorrent::Session - Class Representing a Single .torrent File

Description

Constructor

new ( { [ARGS] } )

Creates a Net::BitTorrent::Session object. This constructor is called by Net::BitTorrent::add_session( ) and should not be used directly.

new( ) accepts arguments as a hash, using key-value pairs:

BaseDir

The root directory used to store the files related to this session. This directory is created if not preexisting.

This is an optional parameter.

Default: ./ (Current working directory)

Client

The Net::BitTorrent object this session will eventually be served from.

This is an optional parameter.

No default. Without a defined parent client, his object is very limited in capability. Basic informaion and <hash checking|/hashcheck> only.

Path

Filename of the .torrent file to load.

This is the only required parameter.

Methods

bitfield

Returns a bitfield representing the pieces that have been successfully downloaded.

files

Returns a list of Net::BitTorrent::Session::File objects representing all files contained in the related .torrent file.

hashcheck

Verifies the integrity of all files associated with this session.

This is a blocking method; all processing will stop until this function returns.

infohash

Returns the 20 byte SHA1 hash used to identify this session internally, with trackers, and with remote peers.

path

Returns the filename of the torrent this object represents.

size

Returns the total size of all files listed in the .torrent file.

trackers

Returns a list of all Net::BitTorrent::Session::Tracker objects related to the session.

Author

Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/

CPAN ID: SANKO

License and Legal

Copyright (C) 2008 by Sanko Robinson <sanko@cpan.org>

This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or http://www.perlfoundation.org/artistic_license_2_0. For clarification, see http://www.perlfoundation.org/artistic_2_0_notes.

When separated from the distribution, all POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See http://creativecommons.org/licenses/by-sa/3.0/us/legalcode. For clarification, see http://creativecommons.org/licenses/by-sa/3.0/us/.

Neither this module nor the Author is affiliated with BitTorrent, Inc.