goczmq icon indicating copy to clipboard operation
goczmq copied to clipboard

There is any example about xpub and xsub?

Open zboya opened this issue 8 years ago • 4 comments

xpub Is any example about this picture?Thanks

zboya avatar Oct 13 '16 01:10 zboya

@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!

taotetek avatar Oct 16 '16 22:10 taotetek

is this still relevant? I have a working xpub-xsub setup (also with CURVE).

erkki avatar Nov 16 '19 02:11 erkki

is this still relevant? I have a working xpub-xsub setup (also with CURVE).

could you share it please with curve

Deeptradingfx avatar Apr 23 '20 14:04 Deeptradingfx

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) } }

jonmandrell avatar Sep 23 '20 19:09 jonmandrell