[noPoll] nopoll_conn_get_msg is blocking unlike what documentation says

Morel Bérenger berenger.morel at sga-automation.com
Thu Dec 21 15:28:08 CET 2017


Hello.

So, this means that the blocking/non-blocking mechanism is related to
the default initialization made by nopoll when creating a connection.
Therefore, I would be tempted to say that the documentation contains an
error:
* it should not say that nopoll_conn_get_msg is not blocking,
* but that nopoll_conn_new (and probably others, but not
nopoll_conn_new_with_socket, and the problem might be the same for the
server-side version of those functions) configures the socket to not be
blocking, by default.

The way it is currently written is confusing, imho.

Le 21/12/2017 à 15:19, Francis Brosnan Blázquez a écrit :
> Hello Morel.
>
> Just confirm nopoll_conn_get_msg design is non-blocking.
>
> If it is blocking, configure socket passed to noPoll reference to be
> non-blocking.
>
> That will make the function to return NULL when nothing is available.
>
> See:
>
> http://www.aspl.es/nopoll/html/group__nopoll__conn_gac8d6596af3f6e20155c7b674555dc078.html#gac8d6596af3f6e20155c7b674555dc078
>
> Best Regards.
>
>
>
> El jue, 21-12-2017 a las 14:59 +0100, Morel Bérenger escribió:
>> Hello.
>>
>> When trying to make nopoll work with my own polling mechanism, I have
>> noticed that nopoll_conn_get_msg is blocking.
>> Here is the stack trace when breaking in with gdb:
>>
>> ====================
>> Program received signal SIGINT, Interrupt.
>> 0x00007ffff70e247d in __libc_recv (fd=10, buf=0x7fffffffcf30, n=2,
>> flags=-1) at ../sysdeps/unix/sysv/linux/x86_64/recv.c:29
>> 29      ../sysdeps/unix/sysv/linux/x86_64/recv.c: Aucun fichier ou
>> dossier de ce type.
>> (gdb) bt
>> #0  0x00007ffff70e247d in __libc_recv (fd=10, buf=0x7fffffffcf30, n=2,
>> flags=-1) at ../sysdeps/unix/sysv/linux/x86_64/recv.c:29
>> #1  0x00007ffff7bcbaeb in nopoll_conn_default_receive (conn=<optimized
>> out>, buffer=0x7fffffffcf30 "\207\254A", buffer_size=<optimized out>) at
>>  nopoll_conn.c:2158
>> #2  0x00007ffff7bcda14 in __nopoll_conn_receive (conn=0x6201b0,
>> buffer=0x7fffffffcf30 "\207\254A", maxlen=2) at nopoll_conn.c:2349
>> #3  0x00007ffff7bcf6e6 in nopoll_conn_get_msg (conn=0x6201b0) at
>> nopoll_conn.c:3231
>> ====================
>>
>> Maybe it is caused by the fact I used "nopoll_conn_new_with_socket( ctx,
>> NULL, socket_fd, ip, port, hostname, url, protocols, NULL);", ctx only
>> behing the result of the nopoll_ctx_new() function?
>>
>
> -- 
>
> Francis Brosnan Blázquez - ASPL
> 91 134 14 22 - 91 134 14 45
>
> http://aspl.es
> http://asplhosting.com
> http://twitter.com/aspl_es
> http://twitter.com/asplhosting
> https://www.linkedin.com/in/francis-brosnan-bl%C3%A1zquez-1353a218/
>
> AVISO LEGAL
>
> Este mensaje se dirige exclusivamente a su destinatario. Los datos
> incluidos en el presente correo son confidenciales y sometidos a
> secreto profesional, se prohíbe divulgarlos, en virtud de las leyes
> vigentes. Si usted no lo es y lo ha recibido por error o tiene
> conocimiento del mismo por cualquier motivo, le rogamos que nos lo
> comunique por este medio y proceda a destruirlo o borrarlo.
>
> 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). 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,
> C/Antonio Suárez 10 A-102, 28802, Alcalá de Henares (Madrid).
>

-- 
SGA Automation
27 Rue Jean-Philippe Rameau
Pôle Delta
76000 Rouen
Tel : 02 32 10 38 53
Fax : 02 32 10 11 30
www.sga-automation.com
Email : berenger.morel at sga-automation.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.aspl.es/pipermail/nopoll/attachments/20171221/038c464b/attachment.html>


More information about the noPoll mailing list