zmq_msg_more.txt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. zmq_msg_more(3)
  2. ===============
  3. NAME
  4. ----
  5. zmq_msg_more - indicate if there are more message parts to receive
  6. SYNOPSIS
  7. --------
  8. *int zmq_msg_more (zmq_msg_t '*message');*
  9. DESCRIPTION
  10. -----------
  11. The _zmq_msg_more()_ function indicates whether this is part of a multi-part
  12. message, and there are further parts to receive. This method can safely be
  13. called after _zmq_msg_close()_. This method is identical to _zmq_msg_get()_
  14. with an argument of ZMQ_MORE.
  15. RETURN VALUE
  16. ------------
  17. The _zmq_msg_more()_ function shall return zero if this is the final part of
  18. a multi-part message, or the only part of a single-part message. It shall
  19. return 1 if there are further parts to receive.
  20. EXAMPLE
  21. -------
  22. .Receiving a multi-part message
  23. ----
  24. zmq_msg_t part;
  25. while (true) {
  26. // Create an empty 0MQ message to hold the message part
  27. int rc = zmq_msg_init (&part);
  28. assert (rc == 0);
  29. // Block until a message is available to be received from socket
  30. rc = zmq_msg_recv (socket, &part, 0);
  31. assert (rc != -1);
  32. if (zmq_msg_more (&part))
  33. fprintf (stderr, "more\n");
  34. else {
  35. fprintf (stderr, "end\n");
  36. break;
  37. }
  38. zmq_msg_close (&part);
  39. }
  40. ----
  41. SEE ALSO
  42. --------
  43. linkzmq:zmq_msg_get[3]
  44. linkzmq:zmq_msg_set[3]
  45. linkzmq:zmq_msg_init[3]
  46. linkzmq:zmq_msg_close[3]
  47. linkzmq:zmq[7]
  48. AUTHORS
  49. -------
  50. This page was written by the 0MQ community. To make a change please
  51. read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.