From 204741348833f456018b441b4bd74c655ad0d3a3 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Tue, 26 Apr 2011 03:19:49 +0200 Subject: [PATCH] Revert "Don't use SO_REUSEADDR on Windows." This reverts commit c1a04b6dfd20344852be85c758552668fbda54df. --- oio-win.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/oio-win.c b/oio-win.c index 354bab51..8e97c68c 100644 --- a/oio-win.c +++ b/oio-win.c @@ -363,6 +363,14 @@ static oio_req* oio_overlapped_to_req(OVERLAPPED* overlapped) { static int oio_set_socket_options(SOCKET socket) { DWORD yes = 1; + /* Set the SO_REUSEADDR option on the socket */ + /* If it fails, soit. */ + setsockopt(socket, + SOL_SOCKET, + SO_REUSEADDR, + (char*)&yes, + sizeof(int)); + /* Make the socket non-inheritable */ if (!SetHandleInformation((HANDLE)socket, HANDLE_FLAG_INHERIT, 0)) { oio_set_sys_error(GetLastError());