Skip to content

Commit

Permalink
Add ability to catch actions within the while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
daneren2005 committed Apr 13, 2014
1 parent 264e853 commit 940c61d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/github/daneren2005/serverproxy/BufferFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ public interface BufferFile {
boolean isWorkDone();
void onStart();
void onStop();
void onResume();
}
4 changes: 4 additions & 0 deletions src/github/daneren2005/serverproxy/BufferProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public void onStart() {
public void onStop() {
progress.onStop();
}
@Override
public void onResume() {
progress.onResume();
}

@Override
public boolean isWorkDone() {
Expand Down
4 changes: 4 additions & 0 deletions src/github/daneren2005/serverproxy/FileProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public void run() {

// Loop as long as there's stuff to send
while (isRunning && !client.isClosed()) {
onResume();

// See if there's more to send
int cbSentThisBatch = 0;
Expand Down Expand Up @@ -200,6 +201,9 @@ public void onStart() {
}
public void onStop() {

}
public void onResume() {

}
public boolean isWorkDone() {
return cbSkip >= file.length();
Expand Down

0 comments on commit 940c61d

Please sign in to comment.