[sldev] Eventlet under windows?
Ryan Williams (Which)
rdw at lindenlab.com
Mon Sep 17 12:30:03 PDT 2007
Baba wrote:
> I've almost got Eventlet working on windows. I got greenlet compiled
> which required vs2003. The last issue is a dependency on fcntl in util.py
Hey, thanks for giving it a try! Windows compatibility is totally one
of Eventlet's major weaknesses.
> fcntl seems to be unix only. Commenting it out gets the examples
> running but that's not the best of solutions. Any ideas?
I confess that I know very little about Windows, but a little googling
turned up some discussions about this very topic, and the conclusion
seemed to be to have conditional code that executes Windows-specific API
calls. Thanks, Python, for making us platform-independent.....NOT.
Seriously if you search for "fcntl windows" the first page of results is
all Python-related, so this seems to be a common sticking point.
I did find this little interesting snippet:
The Unix fcntl() call has no direct equivalent under Winsock. Where
necessary, similar functionality exists in Winsock's ioctlsocket() call.
For example, the equivalent of using Unix's fcntl() to set a socket's
O_NONBLOCK flag is setting the FIONBIO flag with Winsock's ioctlsocket().
Twisted seems to have solved the problem of making sockets nonblocking:
http://itamarst.org/writings/win32sockets.html though this link
doesn't go into the details.
Maybe asyncore works on Windows and can be coopted for this purpose?
-RYaN
More information about the SLDev
mailing list