Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Eventmachine Support on Windows #1600

stakach opened this Issue Mar 8, 2012 · 3 comments


None yet
3 participants

stakach commented Mar 8, 2012


Just wanted to make everyone aware of some of the issues that may crop up around Rubinius support for Windows.
I very much look forward to the Rubinius 2.0 release and thought you may be interested in a recent issue we've been working through on RubyInstaller version of Ruby.

You can see the full discussion here: oneclick/rubyinstaller#104
The eventmachine pull request here: eventmachine/eventmachine#303

Basically it amounts to how Windows deals with socket and file limits and that these limits are defined at compile time (at least for sockets) and any c plugins that use these libraries need to define the same limit to avoid weird and wonderful issues.

Currently it's been decided that the limit should be 32767 sockets, roughly equating to the maximum open sockets possible on a Windows machine.

#define FD_SETSIZE 32767
#include <winsock2.h>
in https://github.com/rubinius/rubinius/blob/master/vm/windows_compat.h

Also there is a limit on maximum file descriptors (which are different to socket descriptors on Windows) that is set to 512
This can be increased using _setmaxstdio(2048); after including #include <stdio.h> the global maximum is 2048.

If everyone sets the same values when it comes to Windows then it'll be much easier to develop and use plugins without having to worry too much about the ruby implementation.

stakach commented Mar 27, 2012

These defines should be set as compiler flags by extconf see discussion at: stakach/eventmachine@9839573

stakach commented Mar 27, 2012

I'm assuming these files are equivalent :

The compiler flag needed for windows is: "CPPFLAGS='-DFD_SETSIZE=32767'"

Hi there - attempting to help by doing some issue triage. Would it be possible to get this documented somewhere and close this issue, possibly in a windows-specific readme?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment