Open zboya opened 8 years ago
@sheepbao - There's no specific example of an XPUB/XSUB proxy currently in the goczmq documentation. The next time I get a little time to code, I could add one if that would be useful for you!
is this still relevant? I have a working xpub-xsub setup (also with CURVE).
is this still relevant? I have a working xpub-xsub setup (also with CURVE).
could you share it please with curve
Here's one I've been working with that doesn't have CURVE yet in it: func main() { log := logger.NewLogger() log.Notice("Starting up XPUBSUB for ports pub:%d and sub:%d\n", PUBLICATION_PORT, SUBSCRIPTION_PORT) // all of the work here is done via the proxy class proxy := zmq.NewProxy() var err error // set up the subscription port connection := fmt.Sprintf(">tcp://localhost:%d", SUBSCRIPTION_PORT) err = proxy.SetFrontend(zmq.XSub, connection) if err != nil { fmt.Println("Cannot set front-end:", err) } // set up the publication port connection = fmt.Sprintf("@tcp://*:%d", PUBLICATION_PORT) err = proxy.SetBackend(zmq.XPub, connection) if err != nil { fmt.Println("Cannot set back-end:", err) } // the proxy runs in a separate thread handling all of the // work. Our main thread just needs to hang around to keep // the application alive. for { time.Sleep(1) } }
Is any example about this picture?Thanks