Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
TCPClient: Fix recv timeout to properly use nanoseconds (#218)
  • Loading branch information
nguydavi authored Sep 23, 2021
commit 24a2933f89fe5e70aba33d3ba4f175915bcabaaa
2 changes: 1 addition & 1 deletion src/main/java/org/xbill/DNS/TCPClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private byte[] _recv(int length) throws IOException {
throw new EOFException();
}
nrecvd += (int) n;
if (nrecvd < length && System.currentTimeMillis() > endTime) {
if (nrecvd < length && endTime - System.nanoTime() < 0) {
throw new SocketTimeoutException();
}
} else {
Expand Down