GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  XS_SETCTXOPT (3)

.ds Aq ’

NAME

xs_setctxopt - set Crossroads context options

CONTENTS

SYNOPSIS

int xs_setctxopt (void *context, int option_name, const void *option_value, size_t option_len);

DESCRIPTION

The xs_setctxopt() function shall set the option specified by the option_name argument to the value pointed to by the option_value argument, for the Crossroads context pointed to by the context argument. The option_len argument is the size of the option value in bytes.

Caution

Context options take effect only if set with xs_setctxopt() prior to creating the first socket in a given context with xs_socket().

The following options can be set with the xs_setctxopt() function:

    XS_MAX_SOCKETS: Set maximum number of sockets

The XS_MAX_SOCKETS option shall set the maximum nuber of sockets that can be simultaneously active in the given context.

    XS_IO_THREADS: Set number of worker threads

The XS_IO_THREADS option shall set the size of the thread pool created by the given context to handle I/O operations. The minimum value for this option is 1.

RETURN VALUE

The xs_setctxopt() function shall return zero if successful. Otherwise it shall return -1 and set errno to one of the values defined below.

ERRORS

EINVAL

The requested option option_name is unknown, or the requested option_len or option_value is invalid.

EFAULT

The provided context was invalid.

EXAMPLE

Setting the number of I/O threads for a context to four..

void *context = xs_init ();
int io_threads = 4;
rc = xs_setctxopt (context, XS_IO_THREADS, &io_threads, sizeof (io_threads));
assert (rc == 0);
/* The above call MUST be called before any socket is created in context */
void *socket = xs_socket (context, XS_PUB);

SEE ALSO

xs_init(3) xs(7)

AUTHORS

The Crossroads documentation was written by Martin Sustrik <\m[blue]sustrik@250bpm.com\m[][1]> and Martin Lucina <\m[blue]martin@lucina.net\m[][2]>.

NOTES

1. sustrik@250bpm.com  mailto:sustrik@250bpm.com
2. martin@lucina.net  mailto:martin@lucina.net
Search for    or go to Top of page |  Section 3 |  Main Index


Crossroads I/O 1&.2&.0 XS_SETCTXOPT (3) 04/03/2016

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.