Re: buffer usage

2016-08-25 Thread Laurent Bercot
OK, now I understand what you're doing. You're declaring a buffer with your own function (listener_read) as a reading function. ... Don't do that. Just declare your buffers with the standard buffer_read function (which is an alias to fd_readsv), it will make your life a lot easier. But I

Re: buffer usage

2016-08-25 Thread Vincent de RIBOU via skaware
Hi Laurent, In fact I face my CB in using 2 calls of 'read' blocked on 2nd call throgu 'buffer_fill', but when using 2 'readv' calls it ends on 0 return code at 2nd call, so succeeds.I don't understand why 'read' can block when 'readv' only ends with nothing read. My CB implementation is :

Re: buffer usage

2016-08-24 Thread Vincent de RIBOU via skaware
Laurent, maybe I was not clear enough. in my buffer CB, set at init, I used 'fd_readsv' instead of my 'listener_read' CB and it works.but it uses 'readv' instead of my 'recvfrom' syscall. not so painfull but in this way I can't know the ID of peer. furthermore, the part of code you mentionned

Re: buffer usage

2016-08-24 Thread Laurent Bercot
static int listener_read(int fd, siovec_t const *io, unsigned int nb) You should not be using a siovec_t and fiddling with fd_readsv if your goal is to use the buffer.h API. siovec_t is used in the *implementation* of the buffer primitives (because the buffer.h buffers are now circular) but

Re: buffer usage

2016-08-24 Thread Vincent de RIBOU via skaware
In using fd_readsv it works correctly.What did I miss in my custom CB? Vincent de RIBOU région Ouest - France belzo2005-dolp...@yahoo.fr Le Mercredi 24 août 2016 10h08, Vincent de RIBOU via skaware a écrit : Laurent, I am interested in using perfectly buffer