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

Re: [Libevent-users] splice()/sendfile() with sockets



On Mon, Jan 27, 2014 at 7:09 PM, Vincent Bernat <bernat@xxxxxxxx> wrote:
> Hi!
>
> Currently, libevent is not using splice() syscall but it is mentioned at
> several places. It could be used in place of sendfile(). This would be
> convenient since it would allow to copy one socket to another through
> event buffers without the data to be copied in user memory. Does the use
> of splice() instead of sendfile() be difficult?
> --

I'd be happy to merge a patch for splice() support.  Have a look at
the evbuffer_splice_sendfile() function to see what you'd need to
change.

Are there any cases where sendfile is necessary because splice won't
work? If so, we'll need to use the flags argument to
evbuffer_file_segment_new() for that.

> Would this allow
> evbuffer_add_file() to be used with sockets?

I don't know; it would be interesting to find out.  The APIs might
also need a bit of tweaking to support that case.

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