1

I am porting a Python-based web server from Linux to Windows. There is a call to socket.fromfd, which is only available in Unix and I've been trying to find a Windows-equivalent with no luck.

I came upon WinSock and WSADuplicateSocket, but these don't seem to be available in Python based on this post: Can I use the winsock api from python?

I know there is also DuplicateHandle, but it is not reliable for sockets. Is there any reliable way to reproduce socket.fromfd for Windows?

Community
  • 1
  • 1
Nebel22
  • 478
  • 8
  • 17

1 Answers1

2

I think there is a patch for this issue, for python windows. I haven`t tried it personally, but this link might help : http://bugs.python.org/issue1378

jester
  • 3,491
  • 19
  • 30
  • nice find! It appears the patch was checked in for Python 3, but never made it into the Python 2 line. – Tim Peters Oct 28 '13 at 04:47
  • Thanks! I am using Python 2.7 though... But I will try to use the same idea as in the patch. I'll accept if I'll get it to work! – Nebel22 Nov 18 '13 at 20:32