Package io.netty.resolver.dns
Class DnsQueryIdSpace.DnsQueryIdRange
java.lang.Object
io.netty.resolver.dns.DnsQueryIdSpace.DnsQueryIdRange
- Enclosing class:
DnsQueryIdSpace
Provides a query if from a range of possible ids.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) intReturn the maximum number of ids that are supported.(package private) intnextId()Returns the next ID to use for a query or-1if there is none left to use.(package private) voidpushId(int id) Push back the id, so it can be used again for the next query.(package private) intReturn how much more usable ids are left.
-
Field Details
-
ids
private final short[] ids -
startId
private final int startId -
count
private int count
-
-
Constructor Details
-
DnsQueryIdRange
DnsQueryIdRange(int bucketSize, int startId)
-
-
Method Details
-
nextId
int nextId()Returns the next ID to use for a query or-1if there is none left to use.- Returns:
- next id to use.
-
pushId
void pushId(int id) Push back the id, so it can be used again for the next query.- Parameters:
id- the id.
-
usableIds
int usableIds()Return how much more usable ids are left.- Returns:
- the number of ids that are left for usage.
-
maxUsableIds
int maxUsableIds()Return the maximum number of ids that are supported.- Returns:
- the maximum number of ids.
-