Skip to content

Commit 24a2933

Browse files
authored
TCPClient: Fix recv timeout to properly use nanoseconds (#218)
1 parent 700856f commit 24a2933

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/xbill/DNS/TCPClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private byte[] _recv(int length) throws IOException {
112112
throw new EOFException();
113113
}
114114
nrecvd += (int) n;
115-
if (nrecvd < length && System.currentTimeMillis() > endTime) {
115+
if (nrecvd < length && endTime - System.nanoTime() < 0) {
116116
throw new SocketTimeoutException();
117117
}
118118
} else {

0 commit comments

Comments
 (0)