]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
update
authorhadaq <hadaq>
Fri, 20 Jul 2012 00:06:42 +0000 (00:06 +0000)
committerhadaq <hadaq>
Fri, 20 Jul 2012 00:06:42 +0000 (00:06 +0000)
libtrbnet/trb3sim.c
libtrbnet/trbnet.c

index 371d1104a19d478542f7b278cf7c6e55b88a4e79..d1b448b2a0eee54634bd5ddd0becbfe7eb5f6c88 100644 (file)
@@ -68,7 +68,7 @@ int main(int count, char *strings[])
     for (i = 0; i < bytes / 2; i++) {
       fprintf(stderr, "%d  0x%04x\n", i, buffer[i]);
     }
-       sleep(6);
+       sleep(7);
     sendto(sd, buffer, bytes, 0, (struct sockaddr *)&addr, sizeof(addr));
        fprintf(stderr, "sendto done\n");
   }
index 9e2b0c4e77b385aa7938e19310d8028bdd19beac..bf05befd884f5cd09130d1b088d5c021fc5b5e36 100644 (file)
@@ -1,11 +1,11 @@
 #ifdef ETRAX
-const char trbnet_version[] = "$Revision: 4.38 $  Local Etrax";
+const char trbnet_version[] = "$Revision: 4.39 $  Local Etrax";
 #elif defined PEXOR
-const char trbnet_version[] = "$Revision: 4.38 $  Local Pexor";
+const char trbnet_version[] = "$Revision: 4.39 $  Local Pexor";
 #elif defined TRB3
-const char trbnet_version[] = "$Revision: 4.38 $  Local TRB3";
+const char trbnet_version[] = "$Revision: 4.39 $  Local TRB3";
 #else
-const char trbnet_version[] = "$Revision: 4.38 $  UNKNOWN, i.e. ERROR";
+const char trbnet_version[] = "$Revision: 4.39 $  UNKNOWN, i.e. ERROR";
 #endif
 
 #include <stdlib.h>
@@ -51,7 +51,6 @@ static uint16_t dataBuffer[4096 * 1024];
 static unsigned int dataBufferSize = 0;  /* Size of dataBuffer in 16Bit words */
 static int trb3_sockfd = -1;
 static struct sockaddr_in trb3_addr;
-static fd_set fds;      /* used by select call */
 static const struct timespec tv = { 
   .tv_sec = 3,          /* UDP timeout for receive call */
   .tv_nsec = 0
@@ -390,6 +389,7 @@ static int getUDPPackage()
 {
   struct sockaddr_in in_addr;
   socklen_t in_addr_len = sizeof(struct sockaddr_in);
+  fd_set fds;      /* used by select call */  
   int status;
   int i;
   
@@ -398,12 +398,10 @@ static int getUDPPackage()
     fprintf(stderr, "Wait UDP Data\n");
   }
   
-  /* Wait for data ready */
-  /* Set Socket Timeout */
-
+  /* Wait for data ready and Set Socket Timeout */
   FD_ZERO(&fds);
   FD_SET(trb3_sockfd, &fds);
-
+  
   status = pselect(trb3_sockfd + 1, &fds, NULL, NULL, &tv, NULL);
   if (status == -1) {
     trb_errno = TRB_TRB3_SOCKET_ERROR;