]> git.saurik.com Git - wxWidgets.git/commitdiff
Commented setsockopt as it doesn't work anywhere. I will use signals for timeout.
authorGuilhem Lavaux <lavaux@easynet.fr>
Sat, 7 Aug 1999 17:03:22 +0000 (17:03 +0000)
committerGuilhem Lavaux <lavaux@easynet.fr>
Sat, 7 Aug 1999 17:03:22 +0000 (17:03 +0000)
Fixed _GSocket_Init_INET.
Only oriented connections should be shutdowned.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/gsocket.c

index af3349248bde41eace128219c713869168258de4..9a575b233c4d43d34fb2e79cfc4314a5e006e420 100644 (file)
@@ -139,7 +139,9 @@ void GSocket_Shutdown(GSocket *socket)
 
   /* If socket has been created, we shutdown it */
   if (socket->m_fd != -1) {
-    shutdown(socket->m_fd, 2);
+    /* Only oriented connection should be shutdowned */
+    if (socket->m_oriented)
+      shutdown(socket->m_fd, 2);
     close(socket->m_fd);
     socket->m_fd = -1;
   }
@@ -518,6 +520,10 @@ void GSocket_SetTimeout(GSocket *socket, unsigned long millisec)
     SO_RCVTIMEO. The man pages, that these flags should exist but
     are read only. RR. */
  /* OK, restrict this to GLIBC 2.1. GL. */
+ /* Anyway, they seem to pose problems: I need to know the socket level and
+    it varies (may be SOL_TCP, SOL_UDP, ...). I disables this and use the
+    other solution. GL. */
+#if 0
 #ifdef CAN_USE_TIMEOUT 
   if (socket->m_fd != -1) {
     struct timeval tval;
@@ -528,6 +534,7 @@ void GSocket_SetTimeout(GSocket *socket, unsigned long millisec)
     setsockopt(socket->m_fd, SOL_SOCKET, SO_RCVTIMEO, &tval, sizeof(tval));
   }
 #endif
+#endif
 }
 
 /*
@@ -962,7 +969,7 @@ GSocketError _GAddress_Init_INET(GAddress *address)
   ((struct sockaddr_in *)address->m_addr)->sin_family = AF_INET;
   ((struct sockaddr_in *)address->m_addr)->sin_addr.s_addr   = INADDR_ANY;
 
-  return TRUE;
+  return GSOCK_NOERROR;
 }
 
 GSocketError GAddress_INET_SetHostName(GAddress *address, const char *hostname)