func SetIoThreads(n int) error {
	return defaultCtx.SetIoThreads(n)
}
/*
Specifies the size of the 0MQ thread pool to handle I/O operations in
the default context. If your application is using only the inproc
transport for messaging you may set this to zero, otherwise set it to at
least one. This option only applies before creating any sockets.

Default value   1
package zmq3
import "C"
import (
	"errors"
	"fmt"
	"runtime"
	"strings"
	"syscall"
	"unsafe"
)
var (
	defaultCtx *Context
)
func init() {
	var err error
	defaultCtx = &Context{}
	defaultCtx.ctx, err = C.zmq_ctx_new()
	if defaultCtx.ctx == nil {
		panic("Init of ZeroMQ context failed: " + errget(err).Error())
	}
}
func errget(err error) error {
	errno, ok := err.(syscall.Errno)
	if ok && errno >= C.ZMQ_HAUSNUMERO {
		return errors.New(C.GoString(C.zmq_strerror(C.int(errno))))
	}
	return err
}
func Version() (major, minor, patch int) {
	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)))
}
type Context struct {
	ctx unsafe.Pointer
}
func NewContext() (ctx *Context, err error) {
	ctx = &Context{}
	c, e := C.zmq_ctx_new()
	if c == nil {
		err = errget(e)
	} else {
		ctx.ctx = c
		runtime.SetFinalizer(ctx, (*Context).Term)
	}
	return
}
func Term() error {
	return defaultCtx.Term()
}
func (ctx *Context) Term() error {
	n, err := C.zmq_ctx_destroy(ctx.ctx)
	if n != 0 {
		return errget(err)
	}
	return nil
}
func getOption(ctx *Context, o C.int) (int, error) {
	nc, err := C.zmq_ctx_get(ctx.ctx, o)
	n := int(nc)
	if n < 0 {
		return n, errget(err)
	}
	return n, nil
}
func GetIoThreads() (int, error) {
	return defaultCtx.GetIoThreads()
}
func (ctx *Context) GetIoThreads() (int, error) {
	return getOption(ctx, C.ZMQ_IO_THREADS)
}
func GetMaxSockets() (int, error) {
	return defaultCtx.GetMaxSockets()
}
func (ctx *Context) GetMaxSockets() (int, error) {
	return getOption(ctx, C.ZMQ_MAX_SOCKETS)
}
func setOption(ctx *Context, o C.int, n int) error {
	i, err := C.zmq_ctx_set(ctx.ctx, o, C.int(n))
	if int(i) != 0 {
		return errget(err)
	}
	return nil
}