| 55 | #endif // ZMQ_HAVE_POLLER |
| 56 | |
| 57 | static int |
| 58 | capture (class zmq::socket_base_t *capture_, zmq::msg_t *msg_, int more_ = 0) |
| 59 | { |
| 60 | // Copy message to capture socket if any |
| 61 | if (capture_) { |
| 62 | zmq::msg_t ctrl; |
| 63 | int rc = ctrl.init (); |
| 64 | if (unlikely (rc < 0)) |
| 65 | return -1; |
| 66 | rc = ctrl.copy (*msg_); |
| 67 | if (unlikely (rc < 0)) |
| 68 | return -1; |
| 69 | rc = capture_->send (&ctrl, more_ ? ZMQ_SNDMORE : 0); |
| 70 | if (unlikely (rc < 0)) |
| 71 | return -1; |
| 72 | } |
| 73 | return 0; |
| 74 | } |
| 75 | |
| 76 | struct stats_socket |
| 77 | { |