[zeromq-dev] Resource temporarily unavailable

Chuck Remes cremes.devlist at mac.com
Wed Jan 18 19:35:04 CET 2012


On Jan 18, 2012, at 11:47 AM, john skaller wrote:

> 
> On 19/01/2012, at 1:03 AM, Martin Sustrik wrote:
>>> 
>>> ~/felix>./hwserver
>>> hwserver, Felix version
>>> 156384763 Operation cannot be accomplished in current state
>> 
>> That means you've sent two subsequent message to a REQ socket, instead of waiting for a reply, or a similar problem.
> 
> Yes, I did that because I got EAGAIN. If I take out the loop on EAGAIN,
> I get .. well I get EAGAIN (code 35 on OSX).

It doesn't matter if you are using a REQ socket for blocking or non-blocking writes. For that socket type you must adhere to a strict send/recv/send/recv pattern. Don't do that.

> Note: I only get this problem when the client sends the message
> to the server, so the server IS reading the message .. well,
> its doing something in response to the message from the client.

May I assume the server has connected via a REP socket? If so, it must adhere to the strict pattern of recv/send/recv/send (flip-flopped from the REQ socket). They work together as a pair. It's not enough for the REP socket to have received a message on the server. Before your client REQ socket can send again, it *must* recv a reply from that REP socket.

This is a fairly common error. You might want to scan the guide again... don't worry, we've all had to read it 3 or 4 times before it sank in. :)

cr




More information about the zeromq-dev mailing list