Skip to content

Commit

Permalink
Merge pull request #43 from lpetrovic05/master
Browse files Browse the repository at this point in the history
fixed port refresh lifetime and sleep
  • Loading branch information
offbynull committed Jul 18, 2019
2 parents 0fc5ddd + 086f036 commit 0a15b04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -62,9 +62,9 @@ System.out.println("Port mapping added: " + mappedPort);
// Refresh mapping half-way through the lifetime of the mapping (for example,
// if the mapping is available for 40 seconds, refresh it every 20 seconds)
while(!shutdown) {
mappedPort = mapper.refreshPort(mappedPort, mappedPort.getLifetime() / 2L);
mappedPort = mapper.refreshPort(mappedPort, mappedPort.getLifetime());
System.out.println("Port mapping refreshed: " + mappedPort);
Thread.sleep(mappedPort.getLifetime() * 1000L);
Thread.sleep(mappedPort.getLifetime() / 2L * 1000L);
}

// Unmap port 12345
Expand Down

0 comments on commit 0a15b04

Please sign in to comment.