From: linxiaohui Date: Thu, 18 Apr 2019 09:10:33 +0000 (+0800) Subject: le-proxy: initiate use of the Winsock DLL X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16d8564a2cd2ec665b577f39eea6583d4b651e92;p=libevent le-proxy: initiate use of the Winsock DLL Closes: #803 (cherry-picked) --- diff --git a/sample/le-proxy.c b/sample/le-proxy.c index 73c48881..13e0e2ae 100644 --- a/sample/le-proxy.c +++ b/sample/le-proxy.c @@ -216,6 +216,13 @@ main(int argc, char **argv) int use_ssl = 0; struct evconnlistener *listener; +#ifdef _WIN32 + WORD wVersionRequested; + WSADATA wsaData; + wVersionRequested = MAKEWORD(2, 2); + (void) WSAStartup(wVersionRequested, &wsaData); +#endif + if (argc < 3) syntax(); @@ -290,5 +297,9 @@ main(int argc, char **argv) evconnlistener_free(listener); event_base_free(base); +#ifdef _WIN32 + WSACleanup(); +#endif + return 0; }