diff options
author | linxiaohui <llinxiaohui@126.com> | 2019-04-18 17:10:33 +0800 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2019-04-18 22:43:16 +0300 |
commit | 16d8564a2cd2ec665b577f39eea6583d4b651e92 (patch) | |
tree | ac86554b909d08034feae59edd170240c20f8c36 /sample | |
parent | 1cd8830de27c30c5324c75bfb6012c969c09ca2c (diff) | |
download | libevent-16d8564a2cd2ec665b577f39eea6583d4b651e92.tar.gz |
le-proxy: initiate use of the Winsock DLL
Closes: #803 (cherry-picked)
Diffstat (limited to 'sample')
-rw-r--r-- | sample/le-proxy.c | 11 |
1 files changed, 11 insertions, 0 deletions
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; } |