Marco, Please read the Guide, it has examples that show how to create and work with protocols like this.
- Pieter On Tue, May 22, 2012 at 1:11 PM, Marco Trapanese <[email protected]> wrote: > Hello, > > currently I'm using zmq on several projects to control remote > applications. In fact, I send 'commands' rather 'data'. > > The architecture of the whole software is pretty simple. There are the > basic functions that do the hard job (my own API). Let's call 'em > func1(), func2() ... > > Then I wrote a raw protocol to call these functions through the zmq > connection. After a message is received, I check the first part to > decode the command and the followings to get the parameters (if any). > Something like this: > > void parseMessage() { > // receive the message, get cmd, argc and argv[] > > switch (cmd) { > case CMD1: > func1(); > break; > > case CMD2: > if (argc == 1) func2(argv[0]); > break; > } > } > > > I wonder how do you implement such an interface. Do you use a method > like this or there is something more flexible/elegant? > > Thanks > Marco > > _______________________________________________ > 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
