<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.8.5">
</HEAD>
<BODY>
Hello Tony.<BR>
<BLOCKQUOTE TYPE=CITE>
    OK, looking in the code for nopoll_loop_wait(), it appears the only two ways<BR>
    the loop can exit are:<BR>
    - ctx->keep_looping cets cleared. This only happens in nopoll_loop_stop()<BR>
    - the wait operation exits with -1 for some reason<BR>
</BLOCKQUOTE>
<BR>
That's right.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
    I didn't have nopoll logging enabled, so can't tell if it was the second.<BR>
</BLOCKQUOTE>
<BR>
Ok.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
    It looks like I could recover from the latter situation with the kludge:<BR>
    <BR>
      do {<BR>
        nopoll_loop_wait(ctx,0);<BR>
      } while(ctx->keep_looping);<BR>
    <BR>
    That would re-invoke it if it had exited abnormally due to a wait error.<BR>
</BLOCKQUOTE>
<BR>
That would do in essense. To complete this, I've updated<BR>
nopoll_loop_wait code to report -3 for timeout errors and -4 for I/O<BR>
wait engine errors.<BR>
<BR>
<A HREF="https://github.com/ASPLes/nopoll/commit/41d06366b1f814a32feff58ef2d4906a25b3a37e">https://github.com/ASPLes/nopoll/commit/41d06366b1f814a32feff58ef2d4906a25b3a37e</A><BR>
<BR>
This way you can extend your solution to only keep on looping on this<BR>
condition.<BR>
<BR>
<A HREF="https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L214">https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L214</A><BR>
<BR>
Best Regards.<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
    Cheers<BR>
    Tony<BR>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>