diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2010-07-13 07:57:29 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2010-07-13 07:57:29 +0200 |
commit | da49e5a4dd4602bf893193a5e6e64af54695b51c (patch) | |
tree | 974d719e06e142c8dd9ea0b97fa1b510abc9b57f /src/streamer.cpp | |
parent | ca057c7db8dcb2384e2498c938f3d83f64b78a7d (diff) |
devices exit in case of context termination
Diffstat (limited to 'src/streamer.cpp')
-rw-r--r-- | src/streamer.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/streamer.cpp b/src/streamer.cpp index 796771b..9799007 100644 --- a/src/streamer.cpp +++ b/src/streamer.cpp @@ -30,8 +30,19 @@ int zmq::streamer (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; |