[noPoll] nopoll_conn_read_pending doesn't seem to be working

Francis Brosnan Blázquez francis.brosnan at aspl.es
Mon Aug 24 08:34:58 CEST 2020


Hello Bill,
Thanks for using noPoll. It is great to see it is useful.
About your question, we have to strengthen nopoll_conn_read_pending
documentation to reflecthow to use it (expected way of working).
It is a function designed to be used *after* you call to
nopoll_conn_read so you can get quickindication if there are pending
data that can be consumed, especially, when you are doing async I/O,so
you can do another nopoll_conn_read without blocking and getting data.
Here you have an example of a library using nopoll_conn_read in
combination with nopoll_conn_read_pending:

https://github.com/ASPLes/libvortex-1.1/blob/master/web-socket/vortex_websocket.c#L404
Best Regards,
El vie, 21-08-2020 a las 19:20 +0000, Bill Goetz escribió:
> Hello,
> 
> 
> 
> 
> 
> 
> 
> So I'm using your nopoll WebSocket library, which I think is really
> solid!
> 
> 
> I am having a problem though with nopoll_conn_read_pending() not
> returning anything > 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.
> 
> 
> 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.
> 
> 
> 
> 
> 
> 
> 
> ANY help would be greatly appreciated!
> 
> 
> 
> 
> 
> 
> 
> printf("before nopoll_conn_read_pending\n");
> 
> while ( 1 ) {
>      // printf("inside while before nopoll_conn_read_pending\n");
>      retStatus = nopoll_conn_read_pending (g_pWebConn);
>      if (retStatus > 0) {
>           printf("AHA! retStatus = %d\n", retStatus);
>           break;
>      }
> }
> 
> 
> 
> printf("after nopoll_conn_read_pending retStatus = %d\n", retStatus);
> 
> 
> 
> if ( retStatus > 0 ) {
>      n_read_int = nopoll_conn_read (g_pWebConn, (char *)(buf +
> n_read_sum), n_to_read, nopoll_false, 1000);
> } else n_read_int = retStatus;
> 
> 
> Regards,
> 
> 
> Bill Goetz
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________noPoll mailing
> listnoPoll at lists.aspl.es
> http://lists.aspl.es/cgi-bin/mailman/listinfo/nopoll


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.aspl.es/pipermail/nopoll/attachments/20200824/912a3930/attachment.html>


More information about the noPoll mailing list