From a376c91494c954491fd424f3b51ab4579b9846a2 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 16 Feb 2012 10:06:36 +0900 Subject: XS_CTX_MAX_SOCKETS option implemented To implement context options properly, initialisation of context is postponed till creation of the first socket. In the meantime it is possible to set socket options. Signed-off-by: Martin Sustrik --- src/xs.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/xs.cpp') diff --git a/src/xs.cpp b/src/xs.cpp index 8fc8dd2..ad5bd97 100644 --- a/src/xs.cpp +++ b/src/xs.cpp @@ -169,6 +169,17 @@ int xs_term (void *ctx_) return rc; } +int xs_setctxopt (void *ctx_, int option_, const void *optval_, + size_t optvallen_) +{ + if (!ctx_ || !((xs::ctx_t*) ctx_)->check_tag ()) { + errno = EFAULT; + return -1; + } + + return ((xs::ctx_t*) ctx_)->setctxopt (option_, optval_, optvallen_); +} + void *xs_socket (void *ctx_, int type_) { if (!ctx_ || !((xs::ctx_t*) ctx_)->check_tag ()) { -- cgit v1.2.3