[zeromq-dev] question on zloop_reader arg #2 type
Steven Butner
butner.se at gmail.com
Sat Apr 18 01:20:47 CEST 2015
I'm trying to get my first zactor implementation finished, compiled, and
debugged. I'm trying to create a zactor (and that seems to work OK).
Once the zactor has been created, I would like to include it in a zloop
reactor but I'm having trouble with type matchup in the following code:
* zactor_t* initActor = zactor_new( myInitActor, (void*)"do_init");
zloop_t* my_reactor = zloop_new();
:
<several other regular socket readers get registered to my_reactor>
:
int rc = zloop_reader( my_reactor, initActor, actorReader, (void*)"" );
*
In the last line above, the compiler doesn't like the type of argument
#2 (which is zactor_t*, of course). The CZMQ3.0.1 synopsis for zactor
says, in part:
"A zactor_t instance acts like a zsock_t and you can pass it to any
CZMQ method that would take a zsock_t argument, including methods in
zframe, zmsg, zstr, zpoller, and *zloop*."
Apparently there is something here that I'm not unde/rstan/ding about
the zactor_t and/or how to use it. Any clarifications or pointers to
examples where actor streams are included in zloop_readers would be
greatly appreciated. Note that I have tried to "fix" the compiler type
mismatch by changing the 2nd argument of the zloop_reader() call above
to be *zactor_sock(initActor)*. Indeed, this makes the compiler happy
but when I run the program I get errno=88 (Socket operation on
non-socket) when one of my lower-level zmq_poll functions attempts to
include the initActor "socket" in its list of polled sockets.
Steve B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150417/b4b85483/attachment.htm>
More information about the zeromq-dev
mailing list