func (ctx *Context) GetIoThreads() (int, error) {
	return getOption(ctx, C.ZMQ_IO_THREADS)
}
Returns the size of the 0MQ thread pool.
package zmq4
import "C"
import (
	"errors"
	"fmt"
	"runtime"
	"strings"
	"unsafe"
)
var (
	defaultCtx *Context
	major, minor, patch int
	ErrorContextClosed         = errors.New("Context is closed")
	ErrorSocketClosed          = errors.New("Socket is closed")
	ErrorMoreExpected          = errors.New("More expected")
	ErrorNotImplemented405     = errors.New("Not implemented, requires 0MQ version 4.0.5")
	ErrorNotImplemented41      = errors.New("Not implemented, requires 0MQ version 4.1")
	ErrorNotImplemented42      = errors.New("Not implemented, requires 0MQ version 4.2")
	ErrorNotImplementedWindows = errors.New("Not implemented on Windows")
	ErrorNoSocket              = errors.New("No such socket")
	initVersionError error
	initContextError error
	api = map[[2]int]int{
		[2]int{0, 0}:  1,
		[2]int{0, 1}:  2,
		[2]int{0, 2}:  3,
		[2]int{0, 3}:  3,
		[2]int{0, 4}:  3,
		[2]int{0, 5}:  4,
		[2]int{0, 6}:  4,
		[2]int{0, 7}:  4,
		[2]int{0, 8}:  4,
		[2]int{0, 9}:  4,
		[2]int{0, 10}: 4,
		[2]int{1, 0}:  5,
		[2]int{1, 1}:  6,
		[2]int{1, 2}:  6,
		[2]int{1, 3}:  6,
		[2]int{1, 4}:  6,
		[2]int{1, 5}:  6,
		[2]int{1, 6}:  7,
		[2]int{1, 7}:  7,
		[2]int{1, 8}:  7,
		[2]int{2, 0}:  8,
		[2]int{2, 1}:  9,
		[2]int{2, 2}:  9,
		[2]int{2, 3}:  9,
		[2]int{2, 4}:  9,
		[2]int{2, 5}:  9,
		[2]int{3, 0}:  10,
		[2]int{3, 1}:  10,
		[2]int{3, 2}:  10,
		[2]int{3, 3}:  10,
		[2]int{3, 4}:  10,
	}
)
func init() {
	major, minor, patch = Version()
	if major != 4 {
		initVersionError = fmt.Errorf("Using zmq4 with ZeroMQ major version %d", major)
		return
	}
	v, ok1 := api[[2]int{minor, patch}]
	w, ok2 := api[[2]int{int(C.zmq4_minor), int(C.zmq4_patch)}]
	if v != w || !ok1 || !ok2 {
		if major != int(C.zmq4_major) || minor != int(C.zmq4_minor) || patch != int(C.zmq4_patch) {
			initVersionError =
				fmt.Errorf(
					"zmq4 was compiled with ZeroMQ version %d.%d.%d, but the runtime links with version %d.%d.%d",
					int(C.zmq4_major), int(C.zmq4_minor), int(C.zmq4_patch),
					major, minor, patch)
			return
		}
	}
	var err error
	defaultCtx = &Context{}
	defaultCtx.ctx, err = C.zmq4_ctx_new()
	if defaultCtx.ctx == nil {
		initContextError = fmt.Errorf("Init of ZeroMQ context failed: %v", errget(err))
		return
	}
	defaultCtx.opened = true
	defaultCtx.retryEINTR = true
}
func Version() (major, minor, patch int) {
	if initVersionError != nil {
		return 0, 0, 0
	}
	var maj, min, pat C.int
	C.zmq_version(&maj, &min, &pat)
	return int(maj), int(min), int(pat)
}
func Error(e int) string {
	return C.GoString(C.zmq_strerror(C.int(e)))
}
const (
	MaxSocketsDflt = int(C.ZMQ_MAX_SOCKETS_DFLT)
	IoThreadsDflt  = int(C.ZMQ_IO_THREADS_DFLT)
)
type Context struct {
	ctx        unsafe.Pointer
	retryEINTR bool
	opened     bool
	err        error
}
func NewContext() (ctx *Context, err error) {
	if initVersionError != nil {
		return nil, initVersionError
	}
	ctx = &Context{}
	c, e := C.zmq4_ctx_new()
	if c == nil {
		err = errget(e)
		ctx.err = err
	} else {
		ctx.ctx = c
		ctx.retryEINTR = true
		ctx.opened = true
		runtime.SetFinalizer(ctx, (*Context).Term)
	}
	return
}
func Term() error {
	if initVersionError != nil {
		return initVersionError
	}
	if initContextError != nil {
		return initContextError
	}
	return defaultCtx.Term()
}
func (ctx *Context) Term() error {
	if ctx.opened {
		ctx.opened = false
		var n C.int
		var err error
		for {
			n, err = C.zmq4_ctx_term(ctx.ctx)
			if n == 0 || !ctx.retry(err) {
				break
			}
		}
		if n != 0 {
			ctx.err = errget(err)
		}
	}
	return ctx.err
}
func getOption(ctx *Context, o C.int) (int, error) {
	if !ctx.opened {
		return 0, ErrorContextClosed
	}
	nc, err := C.zmq4_ctx_get(ctx.ctx, o)
	n := int(nc)
	if n < 0 {
		return n, errget(err)
	}
	return n, nil
}
func GetIoThreads() (int, error) {
	if initVersionError != nil {
		return 0, initVersionError
	}
	if initContextError != nil {
		return 0, initContextError
	}
	return defaultCtx.GetIoThreads()
}