summaryrefslogtreecommitdiff
path: root/src/forwarder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/forwarder.cpp')
-rw-r--r--src/forwarder.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/forwarder.cpp b/src/forwarder.cpp
index 5aab8f2..503868b 100644
--- a/src/forwarder.cpp
+++ b/src/forwarder.cpp
@@ -30,8 +30,19 @@ int zmq::forwarder (socket_base_t *insocket_, socket_base_t *outsocket_)
errno_assert (rc == 0);
while (true) {
- insocket_->recv (&msg, 0);
- outsocket_->send (&msg, 0);
+ rc = insocket_->recv (&msg, 0);
+ if (rc < 0) {
+ if (errno == ETERM)
+ return -1;
+ errno_assert (false);
+ }
+
+ rc = outsocket_->send (&msg, 0);
+ if (rc < 0) {
+ if (errno == ETERM)
+ return -1;
+ errno_assert (false);
+ }
}
return 0;