<!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>
<BR>
I've been reviewing this and the only way for nopoll_loop_wait to<BR>
stop/return is to have an error at:<BR>
<BR>
<A HREF="https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L237">https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L237</A><BR>
(ctx->io_engine->wait returning error)<BR>
<BR>
...or timeout reached (which is not your case):<BR>
<BR>
<A HREF="https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L259">https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L259</A><BR>
<BR>
So, I think there must have been some error while waiting (because some<BR>
socket was in a non-consistent state or something..). I assume you<BR>
don't the log reporting such failure so we can better know error<BR>
reported, right?:<BR>
<BR>
<BLOCKQUOTE>
<FONT COLOR="#0000ff"><A HREF="https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L238">https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L238</A></FONT><BR>
<BR>
<FONT COLOR="#0000ff"><A HREF="https://github.com/ASPLes/nopoll/blob/master/src/nopoll_loop.c#L238nopoll_log">nopoll_log</A> (ctx, NOPOLL_LEVEL_CRITICAL, "Received error from wait operation, error code was: %d", errno);</FONT><BR>
<BR>
</BLOCKQUOTE>
Anyway, reviewing this case I think it would be useful to have<BR>
nopoll_loop_wait to report an error code that indicates these failures<BR>
so you can react by calling nopoll_loop_init code in case of ->wait<BR>
failure to recover. I'm going to review this.<BR>
<BR>
Best Regards.<BR>
<BR>
<BR>
El mar, 19-09-2017 a las 10:51 +0000, Tony Mountifield escribió:
<BLOCKQUOTE TYPE=CITE>
<PRE>
I just had a strange occurrence, and wondered how to go about understanding it.
I have a websocket thread that calls nopoll_loop_wait(ctx,0), which I expected
to continue running until another thread calls nopoll_loop_stop(ctx) as part
of the process termination.
Today, while testing, nopoll_look_wait() had been running fine, but then exited
when I closed one of the accepted connections. I hadn't captured the return status,
but will add code to do that for next time.
I am certain nopoll_loop_stop() had not been called, so I was wondering if there
is any other reason nopoll_loop_wait(ctx,0) would exit after running fine for a time?
I've only ever seen it happen the once.
I'll dig into the code, but wanted to ask here for ideas!
Thanks,
Tony
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>