socket.fromfd for Windows

我与影子孤独终老i 提交于 2019-12-08 04:34:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!