[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] filter bufferevents and timeout



Hi,

I have few questions as I go further in my project:

- regarding bufferevent_filter: I need to retrieve udp data on a socket, filter it according to my protocol and write received data to a file. I was thinking on a read cb tranfering data (evbuffer_add_buffer or evbuffer_add_buffer_reference) from the input buffer of my bufferevent_filter to the output_buffer of another bufferevent linked to my file (mmaped). Is it the right method? How to minimize memory allocation in these operations for a high throughput?

- i read that bufferevent does not support udp yet but it seems to work in my tests (i receive data only, never send) ... What are exacly the limitations ?

Thanks again for your help!
Bruno.

----- Mail original -----
De: "Azat Khuzhin" <a3at.mail@xxxxxxxxx>
À: libevent-users@xxxxxxxxxxxxx
Envoyé: Lundi 6 Novembre 2017 12:30:05
Objet: Re: [Libevent-users] filter bufferevents and timeout

Hi,

> But when done properly it works indeed, thank you!

Great

> - in my input filter callback, is the destination buffer the input buffer of my bufferevent_filter ?

yep, the src is the underlying input, and the dst is the input of the
filtered bufferevent

> - how is used the buffbufferevent_filter_result returned by the input filter callback ?

Kind of the same as for output filter:
- it will call you input callback until you returns BEV_OK (i.e. while
you are processing something) and the underlying input has data
- if it processed something it resets timeouts, and triggers readcb of
filtered bufferevent.

(All this for the case if the filtered input does not have watermarks,
since in this case it can stop earlier)

  Azat.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.