Skip to content
Open
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
20 changes: 10 additions & 10 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ class socket_base
int nbytes = zmq_send(_handle, buf_, len_, flags_);
if (nbytes >= 0)
return static_cast<size_t>(nbytes);
if (zmq_errno() == EAGAIN)
if (zmq_errno() == EAGAIN || zmq_errno() == EINTR)
return 0;
throw error_t();
}
Expand All @@ -1901,7 +1901,7 @@ class socket_base
int nbytes = zmq_msg_send(msg_.handle(), _handle, flags_);
if (nbytes >= 0)
return true;
if (zmq_errno() == EAGAIN)
if (zmq_errno() == EAGAIN || zmq_errno() == EINTR)
return false;
throw error_t();
}
Expand All @@ -1916,7 +1916,7 @@ class socket_base
int nbytes = zmq_msg_send(msg.handle(), _handle, flags_);
if (nbytes >= 0)
return true;
if (zmq_errno() == EAGAIN)
if (zmq_errno() == EAGAIN || zmq_errno() == EINTR)
return false;
throw error_t();
}
Expand All @@ -1941,7 +1941,7 @@ class socket_base
zmq_send(_handle, buf.data(), buf.size(), static_cast<int>(flags));
if (nbytes >= 0)
return static_cast<size_t>(nbytes);
if (zmq_errno() == EAGAIN)
if (zmq_errno() == EAGAIN || zmq_errno() == EINTR)
return {};
throw error_t();
}
Expand All @@ -1951,7 +1951,7 @@ class socket_base
int nbytes = zmq_msg_send(msg.handle(), _handle, static_cast<int>(flags));
if (nbytes >= 0)
return static_cast<size_t>(nbytes);
if (zmq_errno() == EAGAIN)
if (zmq_errno() == EAGAIN || zmq_errno() == EINTR)
return {};
throw error_t();
}
Expand All @@ -1969,7 +1969,7 @@ class socket_base
int nbytes = zmq_recv(_handle, buf_, len_, flags_);
if (nbytes >= 0)
return static_cast<size_t>(nbytes);
if (zmq_errno() == EAGAIN)
if (zmq_errno() == EAGAIN || zmq_errno() == EINTR)
return 0;
throw error_t();
}
Expand All @@ -1981,7 +1981,7 @@ class socket_base
int nbytes = zmq_msg_recv(msg_->handle(), _handle, flags_);
if (nbytes >= 0)
return true;
if (zmq_errno() == EAGAIN)
if (zmq_errno() == EAGAIN || zmq_errno() == EINTR)
return false;
throw error_t();
}
Expand All @@ -1998,7 +1998,7 @@ class socket_base
(std::min)(static_cast<size_t>(nbytes), buf.size()),
static_cast<size_t>(nbytes)};
}
if (zmq_errno() == EAGAIN)
if (zmq_errno() == EAGAIN || zmq_errno() == EINTR)
return {};
throw error_t();
}
Expand All @@ -2012,7 +2012,7 @@ class socket_base
assert(msg.size() == static_cast<size_t>(nbytes));
return static_cast<size_t>(nbytes);
}
if (zmq_errno() == EAGAIN)
if (zmq_errno() == EAGAIN || zmq_errno() == EINTR)
return {};
throw error_t();
}
Expand Down Expand Up @@ -2662,7 +2662,7 @@ template<typename T = no_user_data> class poller_t
return static_cast<size_t>(rc);

#if ZMQ_VERSION >= ZMQ_MAKE_VERSION(4, 2, 3)
if (zmq_errno() == EAGAIN)
if (zmq_errno() == EAGAIN || zmq_errno() == EINTR)
#else
if (zmq_errno() == ETIMEDOUT)
#endif
Expand Down