1 // (c) Bernhard Tittelbach, 2013
6 zmq "github.com/vaughan0/go-zmq"
9 // ---------- ZeroMQ Code -------------
11 func ZmqsInit(pub_addr string) (ctx *zmq.Context, pub_sock *zmq.Socket) {
13 ctx, err = zmq.NewContext()
17 //close only on later panic, otherwise leave open:
18 defer func(){ if r:= recover(); r != nil { ctx.Close(); panic(r) } }()
20 if len(pub_addr) > 0 {
21 pub_sock, err = ctx.Socket(zmq.Pub)
25 defer func() { if r:= recover(); r != nil { pub_sock.Close(); panic(r) } }()
27 if err = pub_sock.Connect(pub_addr); err != nil {
37 func zmqsHandleError(chans *zmq.Channels) {
38 for error := range(chans.Errors()) {