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

Bjorn Reese breese at mail1.stofanet.dk
Mon Aug 6 17:55:49 CEST 2012


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));



More information about the zeromq-dev mailing list