Skip to content

Commit

Permalink
fix issue when data available on both sockets
Browse files Browse the repository at this point in the history
  • Loading branch information
narspt committed Sep 9, 2022
1 parent 069cc37 commit 4fdefbd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions dmrcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <string.h>
#include <netdb.h>
#include <ctype.h>
#include <signal.h>
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -1103,7 +1102,7 @@ int main(int argc, char **argv)
rxlen = recvfrom(udp1, buf, BUFSIZE, 0, (struct sockaddr *)&rx, &l);
udprx = udp1;
}
if(FD_ISSET(udp2, &udpset)) {
else if(FD_ISSET(udp2, &udpset)) {
rxlen = recvfrom(udp2, buf, BUFSIZE, 0, (struct sockaddr *)&rx, &l);
udprx = udp2;
}
Expand Down
3 changes: 1 addition & 2 deletions refcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <string.h>
#include <netdb.h>
#include <ctype.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
Expand Down Expand Up @@ -261,7 +260,7 @@ int main(int argc, char **argv)
rxlen = recvfrom(udp1, buf, BUFSIZE, 0, (struct sockaddr *)&rx, &l);
udprx = udp1;
}
if(FD_ISSET(udp2, &udpset)) {
else if(FD_ISSET(udp2, &udpset)) {
rxlen = recvfrom(udp2, buf, BUFSIZE, 0, (struct sockaddr *)&rx, &l);
udprx = udp2;
}
Expand Down
3 changes: 1 addition & 2 deletions ysfcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <string.h>
#include <netdb.h>
#include <ctype.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
Expand Down Expand Up @@ -1165,7 +1164,7 @@ int main(int argc, char **argv)
rxlen = recvfrom(udp1, buf, BUFSIZE, 0, (struct sockaddr *)&rx, &l);
udprx = udp1;
}
if(FD_ISSET(udp2, &udpset)) {
else if(FD_ISSET(udp2, &udpset)) {
rxlen = recvfrom(udp2, buf, BUFSIZE, 0, (struct sockaddr *)&rx, &l);
udprx = udp2;
}
Expand Down

0 comments on commit 4fdefbd

Please sign in to comment.