示例#1
0
func getOption(o C.int) (int, error) {
	nc, err := C.zmq_ctx_get(ctx, o)
	n := int(nc)
	if n < 0 {
		return n, errget(err)
	}
	return n, nil
}
示例#2
0
文件: zmq4.go 项目: gallir/zmq4
func getOption(ctx *Context, o C.int) (int, error) {
	if !ctx.opened {
		return 0, ErrorContextClosed
	}
	nc, err := C.zmq_ctx_get(ctx.ctx, o)
	n := int(nc)
	if n < 0 {
		return n, errget(err)
	}
	return n, nil
}
示例#3
0
文件: zmq_3_x.go 项目: somia/gozmq
// Get a context option.
// int zmq_ctx_get (void *c, int);
func (c *Context) get(option C.int) (int, error) {
	if c.init(); c.err != nil {
		return -1, c.err
	}
	var value C.int
	var err error
	if value, err = C.zmq_ctx_get(c.c, option); err != nil {
		return -1, casterr(err)
	}
	return int(value), nil
}