zmq_ctx_get_ext.txt 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. zmq_ctx_get_ext(3)
  2. ==================
  3. NAME
  4. ----
  5. zmq_ctx_get_ext - get extended context options
  6. SYNOPSIS
  7. --------
  8. *int zmq_ctx_get_ext (void '*context', int 'option_name', void '*option_value', size_t '*option_len');*
  9. DESCRIPTION
  10. -----------
  11. The _zmq_ctx_get()_ function shall retrieve the value for the option
  12. specified by the 'option_name' argument and store it in the buffer pointed to
  13. by the 'option_value' argument.
  14. The 'option_len' argument is the size in bytes of the buffer pointed
  15. to by 'option_value'; upon successful completion _zmq_ctx_get_ext()_ shall
  16. modify the 'option_len' argument to indicate the actual size of the option
  17. value stored in the buffer.
  18. The _zmq_ctx_get_ext()_ function accepts all the option names accepted by
  19. _zmq_ctx_get()_.
  20. Options that make most sense to retrieve using _zmq_ctx_get_ext()_ instead of
  21. _zmq_ctx_get()_ are:
  22. ZMQ_THREAD_NAME_PREFIX: Get name prefix for I/O threads
  23. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  24. The 'ZMQ_THREAD_NAME_PREFIX' argument gets the string prefix of each thread
  25. created for the internal context's thread pool.
  26. [horizontal]
  27. Option value type:: character string
  28. Option value unit:: N/A
  29. Default value:: empty string
  30. RETURN VALUE
  31. ------------
  32. The _zmq_ctx_get_ext()_ function returns a value of 0 or greater if successful.
  33. Otherwise it returns `-1` and sets 'errno' to one of the values defined
  34. below.
  35. ERRORS
  36. ------
  37. *EINVAL*::
  38. The requested option _option_name_ is unknown.
  39. EXAMPLE
  40. -------
  41. .Setting a prefix on internal ZMQ threda names:
  42. ----
  43. void *context = zmq_ctx_new ();
  44. const char prefix[] = "MyApp";
  45. size_t prefixLen = sizeof(prefix);
  46. zmq_ctx_set (context, ZMQ_THREAD_NAME_PREFIX, &prefix, &prefixLen);
  47. char buff[256];
  48. size_t buffLen = sizeof(buff);
  49. int rc = zmq_ctx_get (context, ZMQ_THREAD_NAME_PREFIX, &buff, &buffLen);
  50. assert (rc == 0);
  51. assert (buffLen == prefixLen);
  52. ----
  53. SEE ALSO
  54. --------
  55. linkzmq:zmq_ctx_get[3]
  56. linkzmq:zmq[7]
  57. AUTHORS
  58. -------
  59. This page was written by the 0MQ community. To make a change please
  60. read the 0MQ Contribution Policy at <http://www.zeromq.org/docs:contributing>.