diff --git a/src/module.h b/src/module.h index 36dd2ee8..fb6451ee 100644 --- a/src/module.h +++ b/src/module.h @@ -13,8 +13,8 @@ #include "util/trash.h" #include -#include #include +#include namespace zmq { class Context; diff --git a/src/socket.cc b/src/socket.cc index 95f8d3ae..bafd86f2 100644 --- a/src/socket.cc +++ b/src/socket.cc @@ -548,7 +548,7 @@ Napi::Value Socket::Send(const Napi::CallbackInfo& info) { #ifdef ZMQ_NO_SYNC_RESOLVE Warn(Env(), "Promise resolution by send() is delayed (ZMQ_NO_SYNC_RESOLVE)."); #else - if (sync_operations++ < max_sync_operations) { + if (send_timeout == 0 || sync_operations++ < max_sync_operations) { auto res = Napi::Promise::Deferred::New(Env()); Send(res, parts); @@ -592,7 +592,7 @@ Napi::Value Socket::Receive(const Napi::CallbackInfo& info) { #ifdef ZMQ_NO_SYNC_RESOLVE Warn(Env(), "Promise resolution by receive() is delayed (ZMQ_NO_SYNC_RESOLVE)."); #else - if (sync_operations++ < max_sync_operations) { + if (receive_timeout == 0 || sync_operations++ < max_sync_operations) { auto res = Napi::Promise::Deferred::New(Env()); Receive(res);