]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/gsocket.cpp
do nothing in ShowHidden() if the flag doesn't change (patch 1678963)
[wxWidgets.git] / src / msw / gsocket.cpp
index 924668cd1f9d43ad3d01f8b4312382cf3b81689b..c107146e2c615ede248523219ddb330278552e40 100644 (file)
@@ -399,8 +399,9 @@ GSocketError GSocket::SetServer()
   /* allow a socket to re-bind if the socket is in the TIME_WAIT
      state after being previously closed.
    */
-  if (m_reusable) {
-    setsockopt(m_fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&arg, sizeof(u_long));
+  if (m_reusable)
+  {
+    setsockopt(m_fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&arg, sizeof(arg));
   }
 
   /* Bind to the local address,
@@ -596,7 +597,7 @@ GSocketError GSocket::Connect(GSocketStream stream)
   // If the reuse flag is set, use the applicable socket reuse flag
   if (m_reusable)
   {
-     setsockopt(m_fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&arg, sizeof(u_long));
+     setsockopt(m_fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&arg, sizeof(arg));
   }
 
   // If a local address has been set, then we need to bind to it before calling connect
@@ -701,6 +702,11 @@ GSocketError GSocket::SetNonOriented()
   ioctlsocket(m_fd, FIONBIO, (u_long FAR *) &arg);
   gs_gui_functions->Enable_Events(this);
 
+  if (m_reusable)
+  {
+    setsockopt(m_fd, SOL_SOCKET, SO_REUSEADDR, (const char*)&arg, sizeof(arg));
+  }
+
   /* Bind to the local address,
    * and retrieve the actual address bound.
    */