mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Test against SO_REUSEADDR (along with _WIN32).
This makes the code build on other systems that also don't have SO_REUSEADDR without requiring special code. [ azat: partially revert WIN32 check since SO_REUSEADDR on win32 differs from unix semantics. ] Closes #275
This commit is contained in:
parent
25e56fdbc1
commit
ce1776c96d
2
evutil.c
2
evutil.c
@ -358,7 +358,7 @@ evutil_fast_socket_nonblocking(evutil_socket_t fd)
|
|||||||
int
|
int
|
||||||
evutil_make_listen_socket_reuseable(evutil_socket_t sock)
|
evutil_make_listen_socket_reuseable(evutil_socket_t sock)
|
||||||
{
|
{
|
||||||
#ifndef _WIN32
|
#if defined(SO_REUSEADDR) && !defined(_WIN32)
|
||||||
int one = 1;
|
int one = 1;
|
||||||
/* REUSEADDR on Unix means, "don't hang on to this address after the
|
/* REUSEADDR on Unix means, "don't hang on to this address after the
|
||||||
* listener is closed." On Windows, though, it means "don't keep other
|
* listener is closed." On Windows, though, it means "don't keep other
|
||||||
|
Loading…
x
Reference in New Issue
Block a user