From 95fdfadaec6d3f5fc6c1054566f5244ee7482d07 Mon Sep 17 00:00:00 2001 From: janz Date: Fri, 25 Oct 2024 10:08:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=B3=BB=E7=BB=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=B7=B3=E5=8F=98=E5=BC=95=E8=B5=B7=E7=9A=84=E9=95=BF?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=97=A0=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeromq-core/src/main/java/zmq/SocketBase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jeromq-core/src/main/java/zmq/SocketBase.java b/jeromq-core/src/main/java/zmq/SocketBase.java index f4d8d383..9115fdc9 100644 --- a/jeromq-core/src/main/java/zmq/SocketBase.java +++ b/jeromq-core/src/main/java/zmq/SocketBase.java @@ -834,7 +834,7 @@ public final boolean send(Msg msg, int flags, AtomicBoolean canceled) // Compute the time when the timeout should occur. // If the timeout is infinite, don't care. int timeout = options.sendTimeout; - long end = timeout < 0 ? 0 : (Clock.nowMS() + timeout); + long end = timeout < 0 ? 0 : (Clock.nowNS() / 1000000 + timeout); // Oops, we couldn't send the message. Wait for the next // command, process it and try to send the message again. @@ -854,7 +854,7 @@ public final boolean send(Msg msg, int flags, AtomicBoolean canceled) } if (timeout > 0) { - timeout = (int) (end - Clock.nowMS()); + timeout = (int) (end - Clock.nowNS() / 1000000); if (timeout <= 0) { errno.set(ZError.EAGAIN); return false;