This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: socket.sendfile() should use TransmitFile on Windows
Type: enhancement Stage: needs patch
Components: Versions: Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: akira, asvetlov, christian.heimes, giampaolo.rodola, gvanrossum, josh.r, josiah.carlson, neologix, pitrou, python-dev, rosslagerwall, yselivanov
Priority: normal Keywords:

Created on 2014-06-11 13:59 by giampaolo.rodola, last changed 2022-04-11 14:58 by admin.

Messages (2)
msg220270 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) Date: 2014-06-11 13:59
This is a follow up of issue 17552 which adds a new socket.sendfile() method taking advantage of high-performance os.sendfile() on UNIX.
The same thing could be done for Windows by using TransmitFile:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms740565(v=vs.85).aspx
msg220410 - (view) Author: Josh Rosenberg (josh.r) * (Python triager) Date: 2014-06-13 01:18
Copying my comment from the previous issue:
For TransmitFile support, the Windows function to turn an integer file descriptor into a WinAPI file HANDLE should be _get_osfhandle: http://msdn.microsoft.com/en-us/library/ks2530z6.aspx

This was mentioned on the previous issue as an issue with using TransmitFile because it was unclear how to convert a file object to a HANDLE compatible with TransmitFile; figured I'm copy over the note on the relevant API for the implementer so the research isn't done twice.
History
Date User Action Args
2022-04-11 14:58:04adminsetgithub: 65920
2014-06-13 01:18:54josh.rsetmessages: + msg220410
2014-06-11 13:59:08giampaolo.rodolacreate