<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr" style="text-align:left; direction:ltr;"><div>Hello Bill,</div><div><br></div><div>Thanks for using noPoll. It is great to see it is useful.</div><div><br></div><div>About your question, we have to strengthen <b>nopoll_conn_read_pending</b> documentation to reflect</div><div>how to use it (expected way of working).</div><div><br></div><div>It is a function designed to be used *after* you call to <b>nopoll_conn_read</b> so you can get quick</div><div>indication if there are pending data that can be consumed, especially, when you are doing async I/O,</div><div>so you can do another nopoll_conn_read without blocking and getting data.</div><div><br></div><div>Here you have an example of a library using nopoll_conn_read in combination with nopoll_conn_read_pending:</div><div><br></div><div><a href="https://github.com/ASPLes/libvortex-1.1/blob/master/web-socket/vortex_websocket.c#L404">https://github.com/ASPLes/libvortex-1.1/blob/master/web-socket/vortex_websocket.c#L404</a></div><div><br></div><div>Best Regards,</div><div><br></div><div>El vie, 21-08-2020 a las 19:20 +0000, Bill Goetz escribió:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hello,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
So I'm using your nopoll WebSocket library, which I think is really solid!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I am having a problem though with nopoll_conn_read_pending() not returning anything > 0. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Here's a small code snip-it. It's never getting to either of the printf's after the nopoll_conn_read_pending() call.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I also know that the server this code is connected to IS writing data on this socket because if I comment out the call to nopoll_conn_read_pending(), data IS read during the nopoll_conn_read() call.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
ANY help would be greatly appreciated!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
printf("before nopoll_conn_read_pending\n");
<div></div>
<div>while ( 1 ) {</div>
<div> // printf("inside while before nopoll_conn_read_pending\n");</div>
<div> retStatus = nopoll_conn_read_pending (g_pWebConn);</div>
<div> if (retStatus > 0) {</div>
<div> printf("AHA! retStatus = %d\n", retStatus);</div>
<div> break;</div>
<div> }</div>
<div>}</div>
<div><br>
</div>
<div>printf("after nopoll_conn_read_pending retStatus = %d\n", retStatus);</div>
<div><br>
</div>
if ( retStatus > 0 ) {
<div> n_read_int = nopoll_conn_read (g_pWebConn, (char *)(buf + n_read_sum), n_to_read, nopoll_false, 1000);</div>
<div>} else n_read_int = retStatus;</div>
<br>
Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Bill Goetz</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<pre>_______________________________________________</pre><pre>noPoll mailing list</pre><pre><a href="mailto:noPoll@lists.aspl.es">noPoll@lists.aspl.es</a></pre><pre><a href="http://lists.aspl.es/cgi-bin/mailman/listinfo/nopoll">http://lists.aspl.es/cgi-bin/mailman/listinfo/nopoll</a></pre><pre><br></pre></blockquote>
<div><span><pre><pre>-- <br></pre>Francis Brosnan Blázquez - ASPL
https://asplhosting.com/
https://myqtthub.com
http://www.aspl.es/
https://twitter.com/aspl_es
https://twitter.com/asplhosting
https://twitter.com/francisbrosnanb
https://es.linkedin.com/in/francis-brosnan-blázquez-1353a218
91 134 14 22 - 91 134 14 45 - 91 116 07 57
Av. Juan Carlos I 13, 2ºC, Torre Garena
28806 - Alcalá de Henares (España)
AVISO LEGAL
En virtud de lo dispuesto en la Ley Orgánica 15/1999, de 13 de
diciembre, de Protección de Datos de Carácter Personal, le informamos de
que sus datos de carácter personal, recogidos de fuentes accesibles al
público o datos que usted nos ha facilitado previamente, proceden de
bases de datos propiedad de Advanced Software Production Line, S.L.
(ASPL).
ASPL garantiza que los datos serán tratados con la finalidad de mantener
las oportunas relaciones comerciales o promocionales con usted o la
entidad que usted representa. No obstante, usted puede ejercitar sus
derechos de acceso, rectificación, cancelación y oposición dispuestos en
la mencionada Ley Orgánica, notificándolo por escrito a ASPL -
Protección Datos, Av. Juan Carlos I 13, 2ºC, Alcalá de Henares
(Madrid).
</pre></span></div></body></html>