[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Libevent 2.0.8 crashes on Windows without WSAStartup



On Oct 26, 2010, at 8:48 PM, Nick Mathewson <nickm@xxxxxxxxxxxxx> wrote:

On Mon, Oct 25, 2010 at 11:02 PM, bottiger1@xxxxxxxxx
<bottiger1@xxxxxxxxx> wrote:
I've compiled libevent on windows 7 32bit with Mingw successfully.
Unfortunately when I run a few test programs, some of them will print:

[warn] evsig_init: socketpair: Successful WSAStartup not yet performed
[WSANOTINITIALISED ]
[warn] evthread_make_base_notifiable: socketpair: Successful
WSAStartup not yet performed [WSANOTINITIALISED ]
Couldn't get an event_base

I found out that the ones that didn't crash like bench_http.c had this
code right before calling event_base_new().

#ifdef WIN32
WSADATA WSAData;
WSAStartup(0x101, &WSAData);

I put that code in, and it seems to fix the problem. Is this intended
behavior?

Not sure.  It's been that way at least since before I started working
on Libevent.

I haven't used libevent in a couple of years, but when I did (1.4, as I recall) libevent didn't create sockets for you. The expectation was *definitely* that you had to run WSAStartup yourself just to do anything with sockets.

That seems reasonable as long as libevent is just dealing with file descriptors that happen to be sockets.
--
 Matthew Weigel
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.