Windows Compilation problem

Chris Hulbert chris.hulbert at
Fri Jun 6 02:35:04 CEST 2008

FYI, i just had the same problem.
To convert from a socket to a file descriptor, you'll need to use this function:

  // for win32: convert from socket to file descriptor
  // //
  int fd = _open_osfhandle(socket,0);

On Thu, Jun 5, 2008 at 6:23 PM, Marc Lehmann <schmorp at> wrote:
> On Wed, Jun 04, 2008 at 04:29:46PM -0700, Matt Tolton <matt at> wrote:
>> Any pointers here?  The fd that I'm using is a socket obtained from
>> the winsock socket() call.  Here is the code used to initialize it:
> That doesn't work - the libev API requires file descriptors on all
> platforms.  What you pass in is a native opertaing system handle that is
> not a file descriptor.

More information about the libev mailing list