Skip to content

Commit

Permalink
add javadoc documentation for upload/download rate-limit functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgoetz committed Jul 22, 2013
1 parent 2e643f4 commit b15ea5e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/com/turn/ttorrent/client/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,22 @@ public Client(InetAddress address, SharedTorrent torrent)
this.random = new Random(System.currentTimeMillis());
}

/**
* Set the maximum download rate (in kb/second) for this
* torrent. A setting of <= 0.0 disables rate limiting.
*
* @param rate The maximum download rate
*/
public void setMaxDownloadRate(double rate){
this.torrent.setMaxDownloadRate(rate);
}

/**
* Set the maximum upload rate (in kb/second) for this
* torrent. A setting of <= 0.0 disables rate limiting.
*
* @param rate The maximum upload rate
*/
public void setMaxUploadRate(double rate){
this.torrent.setMaxUploadRate(rate);
}
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/turn/ttorrent/client/SharedTorrent.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ public double getMaxUploadRate(){
return this.maxUploadRate;
}

/**
* Set the maximum upload rate (in kb/second) for this
* torrent. A setting of <= 0.0 disables rate limiting.
*
* @param rate The maximum upload rate
*/
public void setMaxUploadRate(double rate){
this.maxUploadRate = rate;
}
Expand All @@ -261,6 +267,12 @@ public double getMaxDownloadRate(){
return this.maxDownloadRate;
}

/**
* Set the maximum download rate (in kb/second) for this
* torrent. A setting of <= 0.0 disables rate limiting.
*
* @param rate The maximum download rate
*/
public void setMaxDownloadRate(double rate){
this.maxDownloadRate = rate;
}
Expand Down

1 comment on commit b15ea5e

@antonio1799
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Please sign in to comment.