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");
}
#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>
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
{
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;
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;