X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1a8a61082caeb85192182c9ad77993ba62cc8c2..b19dae2c042116e6346cb09133cbdd5021435d65:/src/msw/gsocket.c diff --git a/src/msw/gsocket.c b/src/msw/gsocket.c index b4156f5afe..20c11ad591 100644 --- a/src/msw/gsocket.c +++ b/src/msw/gsocket.c @@ -25,6 +25,15 @@ * warning: unreferenced formal parameter. */ # pragma warning(disable:4100) + +#ifdef __WXWINCE__ + /* + "unreferenced inline function has been removed": this is not + suppressed by push above as it is given at the end of the + compilation unit + */ +# pragma warning(disable:4514) +#endif /* __WXWINCE__ */ #endif /* _MSC_VER */ #include @@ -376,6 +385,11 @@ GSocketError GSocket_SetServer(GSocket *sck) ioctlsocket(sck->m_fd, FIONBIO, (u_long FAR *) &arg); _GSocket_Enable_Events(sck); + /* allow a socket to re-bind if the socket is in the TIME_WAIT + state after being previously closed. + */ + setsockopt(sck->m_fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&arg, sizeof(u_long)); + /* Bind to the local address, * retrieve the actual address bound, * and listen up to 5 connections.