You need to have the FD_ZERO() and FD_SET() inside the do loop. �select() clears the fd_set if nothing has been seen on a socket.<div><br></div><div>-Alan<br><br><div class="gmail_quote">On Fri, Feb 17, 2012 at 1:06 AM, Arun Chandrasekaran <span dir="ltr">&lt;<a href="mailto:visionofarun@gmail.com">visionofarun@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>Hi Alan,<br>�<br></div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Brief glance at the code - it looks good to me, except for the FD_SET(...) line which seems to have an extra ) after the sock variable.<div>
<br></div><div>I would uncomment the line you have commented. Its likely that if you run this program after amqp_producer.c program, that a frame or two is cached and that the result of amqp_frames_enqueued() is returning true<br>


<br></div></blockquote></div><div><br>Thanks, I&#39;ve done that. But I may be missing something here. So I&#39;ve attached the hg diff to make sure the changes are in the right place for the non-blocking consumer.<br>�<br>
</div><div class="im">
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Also check with the management plugin see if there is a message in the queue ready to be consumed.</div>

</blockquote></div><div><br>Currently I run on RHEL5. So I&#39;ll have to install the latest Erlang, I&#39;ll do that today. Alternatively I have made sure that the message is ready to be consumed by starting the consumer ahead of the producer. Will that suffice?<br>

<br>Thanks,<br>Arun<br></div></div>
</blockquote></div><br></div>