Ross Lagerwall <rosslagerw...@gmail.com> added the comment: Just to be clear:
There are 3 different interfaces. The basic one with the offset included & no headers/trailers is supported by all the platforms, including Linux. The one with offset as None is only supported by Linux. The one with headers/trailers/flags is supported by FreeBSD & OS X. So it does provide a unique interface across all platforms while still providing the ability to access the native functionality. Preferably, I'd like to see a thin wrapper like this remain and then have a sendfile() method added to the socket object which takes a file-like object (not a file descriptor) and optional headers/trailers. This method can then figure out how best to do it depending on the platform. (i.e. using TCP_CORK if necessary, etc). It could even be made to work with file-like objects that cannot be mmap()ed. Why not put it straight in socket anyway? Well, some of the implementations allow sendfile() to have a normal fd as the output. Putting it in socket then would't make sense. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10882> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com