-
-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from robross0606/feature/ttl
Added support for setting ping TTL.
- Loading branch information
Showing
4 changed files
with
59 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
library/src/main/java/com/stealthcopter/networktools/ping/PingOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.stealthcopter.networktools.ping; | ||
|
||
public class PingOptions { | ||
private int timeoutMillis; | ||
private int timeToLive; | ||
|
||
public PingOptions() { | ||
timeToLive = 128; | ||
timeoutMillis = 1000; | ||
} | ||
|
||
public int getTimeoutMillis() { | ||
return timeoutMillis; | ||
} | ||
|
||
public void setTimeoutMillis(int timeoutMillis) { | ||
this.timeoutMillis = Math.max(timeoutMillis, 1000); | ||
} | ||
|
||
public int getTimeToLive() { | ||
return timeToLive; | ||
} | ||
|
||
public void setTimeToLive(int timeToLive) { | ||
this.timeToLive = Math.max(timeToLive, 1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters