[zeromq-dev] why doesnt zeromq socket.recv support interrupts or timeouts

Koert Kuipers Koert.Kuipers at diamondnotch.com
Wed Jan 12 16:52:10 CET 2011


Ah yes of course I should use poll for timeout. Ok that makes sense.
I will put out a separate post with more questions about java recv.

Thanks again. Koert


-----Original Message-----
From: Martin Sustrik [mailto:sustrik at 250bpm.com] 
Sent: Wednesday, January 12, 2011 8:51 AM
To: ZeroMQ development list
Cc: Koert Kuipers
Subject: Re: [zeromq-dev] why doesnt zeromq socket.recv support interrupts or timeouts

Hi Koert,

> For example in java, why doesn't socket.recv throw InterruptedException?

AFAIK it throws org/zeromq/ZMQException that encapsulates the POSIX 
error code returned from the socket. If you want to convert the 
exception to its native java counterpart, feel free to send the patch to 
the mailing list.

> And why is there no version of socket.recv that has a timeout?

No. If you want a timeout you have to poll on the socket. Poll does have 
timout.

Martin




More information about the zeromq-dev mailing list