You could also create another socket used solely for a Terminate message and do 
a zmq_poll on the two sockets. Then the loop would wake when there was work to 
do, or when it was time to quit.

http://api.zeromq.org/4-0:zmq-poll

Cheers,
Matt

On 19 May 2014, at 11:04 pm, Paulmichael Blasucci <pblasu...@gmail.com> wrote:

> Mark,
> 
> Have you considered using a poll-based receive and periodically checking a 
> CancellationToken? This approach has served me quite well in fszmq.
> 
> Cheers.
> 
> Paulmichael
> 
> 
> On Mon, May 19, 2014 at 3:33 AM, mark <manwoodv...@googlemail.com> wrote:
> I have a blocking Receive call that runs on a background thread for as long 
> as the logical endpoint has not be stopped. The call to terminate an endpoint 
> comes from a different thread, meaning the blocking Receive call throws some 
> kind of exception - ObjectDisposed, SEH or AccessViolation.
> 
> Is there a better pattern for this kind of setup? I'm using C# and clrzmq.
> 
> Thanks
> 
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> 
> 
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev@lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to