[zeromq-dev] is socket.recv interruptable in java ?

Koert Kuipers Koert.Kuipers at diamondnotch.com
Thu Jan 13 21:37:56 CET 2011


Only delay for interrupt, right? Not for receiving messages. The poll will exit immediately once something comes in, after which recv will be called immediately. 

-----Original Message-----
From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Alexey Ermakov
Sent: Thursday, January 13, 2011 3:31 PM
To: ZeroMQ development list
Subject: Re: [zeromq-dev] is socket.recv interruptable in java ?

On Thu, Jan 13, 2011 at 9:48 PM, Koert Kuipers
<Koert.Kuipers at diamondnotch.com> wrote:
> An interruptable_recv function can be build using the poll and recv functions....

If you don't mind the delay and threads waking up to check the
interrupted status, yes. Doing that properly would require spawning an
additional thread for each context that would check the interrupt
statuses and automatically attaching a signalling socket to the poll()
requests.

> -----Original Message-----
> From: zeromq-dev-bounces at lists.zeromq.org [mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of Alexey Ermakov
> Sent: Thursday, January 13, 2011 1:08 PM
> To: ZeroMQ development list
> Subject: Re: [zeromq-dev] is socket.recv interruptable in java ?
>
> jzmq doesn't support Thread.interrupt() at all. Supporting it in
> Socket.recv() would be impossible (assuming that it remains as close
> as possible to zmq_recv), and supporting it in poll() might be doable,
> but is going to be quite hard. Your best options are using poll() with
> timeouts or using an inproc signalling socket to wakeup the receiving
> thread.
>
> On Wed, Jan 12, 2011 at 6:54 PM, Koert Kuipers
> <Koert.Kuipers at diamondnotch.com> wrote:
>> In the java code I cannot find any indication that recv() is interruptable.
>> Also recv does not throw any checked exceptions such as
>> InterruptedException. Can anyone provide more info on this for me?
>>
>> Thanks koert
>>
>>
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
_______________________________________________
zeromq-dev mailing list
zeromq-dev at lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list