Exemple #1
0
func setOption(o C.int, n int) error {
	i, err := C.zmq_ctx_set(ctx, o, C.int(n))
	if int(i) != 0 {
		return errget(err)
	}
	return nil
}
Exemple #2
0
// Set a context option.
// int zmq_ctx_set (void *c, int, int);
func (c *Context) set(option C.int, value int) error {
	if c.init(); c.err != nil {
		return c.err
	}
	if rc, err := C.zmq_ctx_set(c.c, option, C.int(value)); rc == -1 {
		return casterr(err)
	}
	return nil
}
Exemple #3
0
func setOption(ctx *Context, o C.int, n int) error {
	if !ctx.opened {
		return ErrorContextClosed
	}
	i, err := C.zmq_ctx_set(ctx.ctx, o, C.int(n))
	if int(i) != 0 {
		return errget(err)
	}
	return nil
}