[zeromq-dev] Code-style question
Marco Trapanese
marcotrapanese at gmail.com
Tue May 22 20:11:51 CEST 2012
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
More information about the zeromq-dev
mailing list