Skip to content

Commit

Permalink
WIN32: fix epicsSocketEnableAddressReuseDuringTimeWaitState()
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Jun 20, 2020
1 parent 4eb8ea3 commit 19146a5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/libcom/src/osi/os/default/osdSockAddrReuse.cpp
Expand Up @@ -22,6 +22,15 @@
LIBCOM_API void epicsStdCall
epicsSocketEnableAddressReuseDuringTimeWaitState ( SOCKET s )
{
#ifdef _WIN32
/*
* Note: WINSOCK appears to assign a different functionality for
* SO_REUSEADDR compared to other OS. With WINSOCK SO_REUSEADDR indicates
* that simultaneously servers can bind to the same TCP port on the same host!
* Also, servers are always enabled to reuse a port immediately after
* they exit ( even if SO_REUSEADDR isnt set ).
*/
#else
int yes = true;
int status;
status = setsockopt ( s, SOL_SOCKET, SO_REUSEADDR,
Expand All @@ -31,6 +40,7 @@ LIBCOM_API void epicsStdCall
"epicsSocketEnableAddressReuseDuringTimeWaitState: "
"unable to set SO_REUSEADDR?\n");
}
#endif
}

static
Expand Down

0 comments on commit 19146a5

Please sign in to comment.