libktorrent  2.1.1
Classes | Public Slots | Signals | Public Member Functions | Static Public Member Functions | List of all members
bt::WebSeed Class Reference

#include <webseed.h>

Inheritance diagram for bt::WebSeed:
Inheritance graph
[legend]

Public Slots

void reset ()
 

Signals

void chunkDownloadFinished (WebSeedChunkDownload *cd, Uint32 chunk)
 
void chunkDownloadStarted (WebSeedChunkDownload *cd, Uint32 chunk)
 
void chunkReady (Chunk *c)
 
void finished ()
 

Public Member Functions

 WebSeed (const QUrl &url, bool user, const Torrent &tor, ChunkManager &cman)
 
bool busy () const
 Is this webseed busy ?
 
void cancel ()
 
void chunkDownloaded (Uint32 chunk)
 
WebSeedChunkDownloadcurrentChunkDownload ()
 Get the current webseed download.
 
void disable (const QString &reason)
 Disable the webseed.
 
void download (Uint32 first, Uint32 last)
 
Uint32 failedAttempts () const
 Get the number of failed attempts.
 
Uint32 getDownloadRate () const override
 Get the current download rate.
 
bool inCurrentRange (Uint32 chunk) const
 Check if a chunk lies in the current range we are downloading.
 
void onExcluded (Uint32 from, Uint32 to)
 
void setEnabled (bool on) override
 Disable or enable the webseed.
 
void setGroupIDs (Uint32 up, Uint32 down)
 
Uint32 update ()
 
- Public Member Functions inherited from bt::WebSeedInterface
 WebSeedInterface (const QUrl &url, bool user)
 
QString getStatus () const
 Get the present status in string form.
 
Uint64 getTotalDownloaded () const
 Get how much data was downloaded.
 
const QUrl & getUrl () const
 Get the URL of the webseed.
 
bool isEnabled () const
 Wether or not the webseed is enabled.
 
bool isUserCreated () const
 Whether or not this webseed was user created.
 

Static Public Member Functions

static void setProxy (const QString &host, bt::Uint16 port)
 
static void setProxyEnabled (bool on)
 

Additional Inherited Members

- Protected Attributes inherited from bt::WebSeedInterface
bool enabled
 
QString status
 
Uint64 total_downloaded
 
QUrl url
 
bool user
 

Detailed Description

Author
Joris Guisson Class which handles downloading from a webseed

Definition at line 66 of file webseed.h.

Member Function Documentation

◆ cancel()

void bt::WebSeed::cancel ( )

Cancel the current download and kill the connection

◆ chunkDownloaded()

void bt::WebSeed::chunkDownloaded ( Uint32  chunk)

A chunk has been downloaded.

Parameters
chunkThe chunk

◆ chunkDownloadFinished

void bt::WebSeed::chunkDownloadFinished ( WebSeedChunkDownload cd,
Uint32  chunk 
)
signal

A ChunkDownload was finished

Parameters
cdThe ChunkDownloadInterface
chunkThe chunk which is being stopped

◆ chunkDownloadStarted

void bt::WebSeed::chunkDownloadStarted ( WebSeedChunkDownload cd,
Uint32  chunk 
)
signal

A ChunkDownload was started

Parameters
cdThe ChunkDownloadInterface
chunkThe chunk which is being started

◆ chunkReady

void bt::WebSeed::chunkReady ( Chunk c)
signal

Emitted when a chunk is downloaded

Parameters
cThe chunk

◆ download()

void bt::WebSeed::download ( Uint32  first,
Uint32  last 
)

Download a range of chunks

Parameters
firstThe first chunk
lastThe last chunk

◆ finished

void bt::WebSeed::finished ( )
signal

Emitted when a range has been fully downloaded

◆ onExcluded()

void bt::WebSeed::onExcluded ( Uint32  from,
Uint32  to 
)

A range has been excluded, if we are fully downloading in this range, reset.

Parameters
fromStart of range
toEnd of range

◆ reset

void bt::WebSeed::reset ( )
slot

Reset the webseed (kills the connection)

◆ setGroupIDs()

void bt::WebSeed::setGroupIDs ( Uint32  up,
Uint32  down 
)

Set the group ID's of the http connection (for speed limits)

Parameters
upUpload group id
downDownload group id

◆ setProxy()

static void bt::WebSeed::setProxy ( const QString &  host,
bt::Uint16  port 
)
static

Set the proxy to use for all WebSeeds

Parameters
hostHostname or IP address of the proxy
portPort number of the proxy

◆ setProxyEnabled()

static void bt::WebSeed::setProxyEnabled ( bool  on)
static

Whether or not to enable or disable the use of a proxy. When the proxy is disabled, we will use the KDE proxy settings.

Parameters
onOn or not

◆ update()

Uint32 bt::WebSeed::update ( )

Check if the connection has received some data and handle it.

Returns
The number of bytes downloaded

The documentation for this class was generated from the following file: