'\" t .\" Title: zmq_ctx_set_ext .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 10/23/2023 .\" Manual: 0MQ Manual .\" Source: 0MQ 4.3.5 .\" Language: English .\" .TH "ZMQ_CTX_SET_EXT" "3" "10/23/2023" "0MQ 4\&.3\&.5" "0MQ Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zmq_ctx_set_ext \- set extended context options .SH "SYNOPSIS" .sp \fBint zmq_ctx_set_ext (void \fR\fB\fI*context\fR\fR\fB, int \fR\fB\fIoption_name\fR\fR\fB, const void \fR\fB\fI*option_value\fR\fR\fB, size_t \fR\fB\fIoption_len\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fIzmq_ctx_set_ext()\fR function shall set the option specified by the \fIoption_name\fR argument to the value pointed to by the \fIoption_value\fR argument for the 0MQ context pointed to by the \fIcontext\fR argument\&. The \fIoption_len\fR argument is the size of the option value in bytes\&. For options taking a value of type "character string", the provided byte data should either contain no zero bytes, or end in a single zero byte (terminating ASCII NUL character)\&. .sp The \fIzmq_ctx_set_ext()\fR function accepts all the option names accepted by \fIzmq_ctx_set()\fR\&. Options that make most sense to set using \fIzmq_ctx_set_ext()\fR instead of \fIzmq_ctx_set()\fR are the following options: .SS "ZMQ_THREAD_NAME_PREFIX: Set name prefix for I/O threads" .sp The \fIZMQ_THREAD_NAME_PREFIX\fR argument sets a string prefix to each thread created for the internal context\(cqs thread pool\&. This option is only supported on Linux\&. This option is useful to help debugging done via "top \-H" or "gdb"; in case multiple processes on the system are using ZeroMQ it is useful to provide through this context option an application\-specific prefix to distinguish ZeroMQ background threads that belong to different processes\&. This option only applies before creating any sockets on the context\&. .TS tab(:); lt lt lt lt lt lt. T{ .sp Option value type T}:T{ .sp character string T} T{ .sp Option value unit T}:T{ .sp N/A T} T{ .sp Default value T}:T{ .sp empty string T} .TE .sp 1 .SH "RETURN VALUE" .sp The \fIzmq_ctx_set_ext()\fR function returns zero if successful\&. Otherwise it returns \-1 and sets \fIerrno\fR to one of the values defined below\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The requested option \fIoption_name\fR is unknown\&. .RE .PP \fBEFAULT\fR .RS 4 The provided \fIcontext\fR is invalid\&. .RE .SH "EXAMPLE" .PP \fBSetting a prefix on internal ZMQ thread names:\fR. .sp .if n \{\ .RS 4 .\} .nf void *context = zmq_ctx_new (); const char prefix[] = "MyApp"; size_t prefixLen = sizeof(prefix); zmq_ctx_set (context, ZMQ_THREAD_NAME_PREFIX, &prefix, &prefixLen); char buff[256]; size_t buffLen = sizeof(buff); int rc = zmq_ctx_get (context, ZMQ_THREAD_NAME_PREFIX, &buff, &buffLen); assert (rc == 0); assert (buffLen == prefixLen); .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .sp \fBzmq_ctx_set\fR(3) \fBzmq\fR(7) .SH "AUTHORS" .sp This page was written by the 0MQ community\&. To make a change please read the 0MQ Contribution Policy at \m[blue]\fBhttp://www\&.zeromq\&.org/docs:contributing\fR\m[]\&.