Skip to content

Commit

Permalink
Merge pull request #209 from jessedusty/master
Browse files Browse the repository at this point in the history
Fix #154 - relay dies with AssertionError
  • Loading branch information
rom1v committed Sep 7, 2019
2 parents cfc63a2 + c814bfb commit 7ce96ab
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ public void run() throws IOException {
Set<SelectionKey> selectedKeys = selector.selectedKeys();

long now = System.currentTimeMillis();
if (now >= nextCleaningDeadline) {
if (now >= nextCleaningDeadline || selectedKeys.isEmpty()) {
tunnelServer.cleanUp();
nextCleaningDeadline = now + CLEANING_INTERVAL;
} else if (selectedKeys.isEmpty()) {
throw new AssertionError("selector.select() returned without any event, an invalid SelectionKey was probably been registered");
}

for (SelectionKey selectedKey : selectedKeys) {
Expand Down

0 comments on commit 7ce96ab

Please sign in to comment.