[zeromq-dev] Interrupted System Call: advice to handle it

Andrew Hume andrew at research.att.com
Mon Aug 6 18:00:33 CEST 2012


in any case, don't forget the EAGAIN case
(which seems to be rather more common in MacOS environments).

On Aug 6, 2012, at 8:55 AM, Bjorn Reese wrote:

> On 2012-08-06 13:58, Raphael Bauduin wrote:
> 
>> I thought to replace this call (see code at
>> https://github.com/zeromq/rbzmq/blob/master/rbzmq.c#L1573 )
>> 
>>         rc = zmq_send (s,&msg, flags);
>> 
>> by this:
>> 
>>     int do_loop=1;
>>     while ( do_loop>0) {
>>         rc = zmq_send (s,&msg, flags);
>>         if (rc==0 || zmq_errno () != EINTR)
>>             do_loop=0;
>>     }
> 
> Or the more common form of this idiom:
> 
> 	do {
> 	  rc = zmq_send(s, &msg, flags);
> 	} while ((rc == -1) && (zmq_errno() == EINTR));
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev


------------------
Andrew Hume  (best -> Telework) +1 623-551-2845
andrew at research.att.com  (Work) +1 973-236-2014
AT&T Labs - Research; member of USENIX and LOPSA




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120806/3c3cc7f1/attachment.htm>


More information about the zeromq-dev mailing list