]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/gsocket.c
Applied patch for hiding statusbar.
[wxWidgets.git] / src / msw / gsocket.c
index b4156f5afead4d8cef10d522b47ac46dde9b62b9..50121a09001fbcb889a87dbe02981e9157588216 100644 (file)
     * 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 <winsock.h>
@@ -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.
@@ -766,7 +780,7 @@ GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags)
     FD_ZERO(&writefds);
     FD_ZERO(&exceptfds);
     FD_SET(socket->m_fd, &readfds);
-       if (flags & GSOCK_OUTPUT_FLAG)
+       if (flags & GSOCK_OUTPUT_FLAG || flags & GSOCK_CONNECTION_FLAG)
       FD_SET(socket->m_fd, &writefds);
     FD_SET(socket->m_fd, &exceptfds);