As a general rule, make a quick end-to-end prototype without spending too much time (a few hours or days), then test carefully to see how it performs.
In your specific case, creating a new connection for each message is meaningless. Instead, maintain a set of sockets, each connected to a peer node, and then find the right socket, and send the message to it. You can create this set of sockets when you start, e.g. from a configuration listing all peers. -Pieter On Sun, Dec 20, 2015 at 2:58 AM, chubbson <[email protected]> wrote: > ________________________________ > > Hey zmq Folk, > > Resending this request. > For my new work i have to implement and integrate 'chat'-functionality. > > A message should send from node A to node B. > A and B are in different subnet and doesnt know each other directly. > But A knows the routing path to send a msg to B (ViceVersa, B knows the > routing path for sending a message to A) > > my first approach feels conceptually wrong. wrapping the msg with routing > nodes. > push / pull to next node. > each pull socket listen on the wire, unwrap the message, creates a new push > socket connection and forward the message to unwrapped node. > Currently im put the routing path information directly to serialized > message. > > > what is the common way to solve this kind of problem? > Isnt it a performance issue?, establishing a new connection per received > msg, just for getting the next routing endpoint where the message should be > sent to. > > https://gist.github.com/chubbson/8fc8d7d1c843e649398f > > Cheers > > > _______________________________________________ > zeromq-dev mailing list > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev > _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
