From: hadaq Date: Fri, 20 Jul 2012 00:06:42 +0000 (+0000) Subject: update X-Git-Tag: v6.0~19 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=3e4c95869b0163ccca727efbe0034b58520260de;p=trbnettools.git update --- diff --git a/libtrbnet/trb3sim.c b/libtrbnet/trb3sim.c index 371d110..d1b448b 100644 --- a/libtrbnet/trb3sim.c +++ b/libtrbnet/trb3sim.c @@ -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"); } diff --git a/libtrbnet/trbnet.c b/libtrbnet/trbnet.c index 9e2b0c4..bf05bef 100644 --- a/libtrbnet/trbnet.c +++ b/libtrbnet/trbnet.c @@ -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 @@ -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;