]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
speed up discovery for radioberry
authorRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Fri, 28 Oct 2022 09:09:41 +0000 (14:39 +0530)
committerRamakrishnan Muthukrishnan <ram@rkrishnan.org>
Fri, 28 Oct 2022 09:09:41 +0000 (14:39 +0530)
Do not look at TCP Port, only look at localhost

old_discovery.c

index 748b8ab84bddfe7098b1432f3873f4930b6dc893..7f27ee7b4aa9f63b1069b4fb4aa00ab120c304a1 100644 (file)
@@ -252,7 +252,7 @@ int stemlab_get_info(int id) {
   int optval,i;
 
   // Allow RP app to come up
-  sleep(2);
+  //sleep(2);
 
   devices=id;
 
@@ -523,8 +523,8 @@ fprintf(stderr,"old_discovery\n");
         g_main_context_iteration(NULL, 0);
         if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_INET) {
             if((ifa->ifa_flags&IFF_UP)==IFF_UP
-                && (ifa->ifa_flags&IFF_RUNNING)==IFF_RUNNING) {
-                //&& (ifa->ifa_flags&IFF_LOOPBACK)!=IFF_LOOPBACK) {
+                && (ifa->ifa_flags&IFF_RUNNING)==IFF_RUNNING
+                && (ifa->ifa_flags&IFF_LOOPBACK)==IFF_LOOPBACK) {
                 discover(ifa);
             }
         }
@@ -533,7 +533,7 @@ fprintf(stderr,"old_discovery\n");
     freeifaddrs(addrs);
 
     // Do one additional "discover" for a fixed TCP address
-    discover(NULL);
+    // discover(NULL);
 
     fprintf(stderr, "discovery found %d devices\n",devices);