[netperf-dev] netperf2 commit notice r426 - trunk/src

raj at netperf.org raj at netperf.org
Tue Jul 12 11:58:00 PDT 2011


Author: raj
Date: 2011-07-12 11:58:00 -0700 (Tue, 12 Jul 2011)
New Revision: 426

Modified:
   trunk/src/netserver.c
Log:
do not be quite so picky about a socket call failure

Modified: trunk/src/netserver.c
===================================================================
--- trunk/src/netserver.c	2011-07-12 18:33:05 UTC (rev 425)
+++ trunk/src/netserver.c	2011-07-12 18:58:00 UTC (rev 426)
@@ -388,17 +388,21 @@
     }
   } while ((error == EAI_AGAIN) && (count <= 5));
 
-  if ((error) && (debug)) {
-    fprintf(stderr,
-	    "%s: could not resolve remote '%s' port '%s' af %d\n"
-	    "\tgetaddrinfo returned %s (%d)\n",
-	    __FUNCTION__,
-	    hostname,
-	    port,
-	    af,
-	    gai_strerror(error),
-	    error);
-
+  if (error) {
+    if (debug) {
+      
+      fprintf(stderr,
+	      "%s: could not resolve remote '%s' port '%s' af %d\n"
+	      "\tgetaddrinfo returned %s (%d)\n",
+	      __FUNCTION__,
+	      hostname,
+	      port,
+	      af,
+	      gai_strerror(error),
+	      error);
+      
+    }
+    return;
   }
 
   if (debug) {
@@ -412,13 +416,16 @@
     temp_socket = socket(local_res_temp->ai_family,SOCK_STREAM,0);
 
     if (temp_socket == INVALID_SOCKET) {
-      fprintf(stderr,
-	      "%s could not allocate a socket: %s (errno %d)\n",
-	      __FUNCTION__,
-	      strerror(errno),
-	      errno);
-      fflush(stderr);
-      exit(-1);
+      if (debug) {
+	fprintf(stderr,
+		"%s could not allocate a socket: %s (errno %d)\n",
+		__FUNCTION__,
+		strerror(errno),
+		errno);
+	fflush(stderr);
+      }
+      local_res_temp = local_res_temp->ai_next;
+      continue;
     }
 
     /* happiness and joy, keep going */
@@ -1378,7 +1385,6 @@
   }
 #endif /* WIN32 */
 
-  fprintf(stderr,"ASD Save program\n");
   /* Save away the program name */
   program = (char *)malloc(strlen(argv[0]) + 1);
   if (program == NULL) {



More information about the netperf-dev mailing list