func init() { var err error ctx, err = C.zmq_ctx_new() if ctx == nil { panic("Init of ZeroMQ context failed: " + errget(err).Error()) } }
func init() { var err error defaultCtx = &Context{} defaultCtx.ctx, err = C.zmq_ctx_new() defaultCtx.opened = true if defaultCtx.ctx == nil { panic("Init of ZeroMQ context failed: " + errget(err).Error()) } }
// Create a new context. func NewContext() (ctx *Context, err error) { ctx = &Context{} c, e := C.zmq_ctx_new() if c == nil { err = errget(e) ctx.err = err } else { ctx.ctx = c ctx.opened = true runtime.SetFinalizer(ctx, (*Context).Term) } return }
func init() { var err error defaultCtx = &Context{} defaultCtx.ctx, err = C.zmq_ctx_new() defaultCtx.opened = true if defaultCtx.ctx == nil { panic("Init of ZeroMQ context failed: " + errget(err).Error()) } major, minor, patch = Version() if major != 4 { panic("Using zmq4 with ZeroMQ major version " + fmt.Sprint(major)) } if major != int(C.zmq4_major) || minor != int(C.zmq4_minor) { panic( fmt.Sprintf( "zmq4 was installed with ZeroMQ version %d.%d.%d, but the application links with version %d.%d.%d", int(C.zmq4_major), int(C.zmq4_minor), int(C.zmq4_patch), major, minor, patch)) } }
func createZmqContext() unsafe.Pointer { return C.zmq_ctx_new() }