问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/19627251/socket-fromfd-for-windows