On Tue, Feb 8, 2011 at 2:49 PM, Pieter Hintjens <[email protected]> wrote: > Hi James, > > You would want to use XREQ and XREP sockets, probably, and manage > timeouts using poll. There is a fairly detailed example of an RPC > client and server in C, which can help give a design. > > https://github.com/zeromq/zfl/blob/master/src/zfl_rpc.c (client) > https://github.com/zeromq/zfl/blob/master/src/zfl_rpcd.c (server) >
That would probably be the pinnacle of what I'm after, but it is overkill for what I'm trying to solve right now. It would also take me a while to go through the ZFL library to really comment on this (as far as I see, there's no equivalent for the higher-language bindings). May a simpler question to get me going; Is there a fast way to detect a server that's not available? With a socket, I would get a "connection refused", and move on from there. With zmq, it lets me send(), and then hangs on recv(). I could poll the zmq socket with a timeout, but it seems an unavailable server should be able to fail fast. -jim _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
