- Timestamp:
- 11/01/17 10:24:26 (3 years ago)
- Branches:
- cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
- Children:
- 8fa0167
- Parents:
- ea75ec2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_ndag.c
rea75ec2 r6e16301 638 638 639 639 fd_set allgroups; 640 int maxfd, i, ret, readybufs ;640 int maxfd, i, ret, readybufs, availsocks; 641 641 struct timeval timeout; 642 642 643 FD_ZERO(&allgroups);644 643 maxfd = 0; 645 644 timeout.tv_sec = 0; … … 650 649 * port. 651 650 */ 651 652 readybufs = 0; 653 availsocks = 0; 652 654 653 655 for (i = 0; i < rt->sourcecount; i ++) { … … 657 659 maxfd = rt->sources[i].sock; 658 660 } 659 } 660 } 661 661 availsocks += 1; 662 } else if (rt->sources[i].sock != -1) { 663 readybufs += 1; 664 availsocks += 1; 665 } 666 } 667 668 /* If all of our sockets already have data sitting in their 669 * buffers then we can save ourselves some 'select'ing. 670 */ 671 if (availsocks == readybufs) { 672 return readybufs; 673 } 674 675 /* Otherwise, at least one active socket has an empty buffer so 676 * we better try to read some data from those sockets (just in 677 * case the correct 'next' packet is waiting on one of those 678 * sockets. 679 */ 680 FD_ZERO(&allgroups); 662 681 if (select(maxfd + 1, &allgroups, NULL, NULL, &timeout) < 0) { 663 682 fprintf(stderr, "Error waiting to receive records: %s\n", … … 666 685 } 667 686 668 readybufs = 0;669 687 670 688 for (i = 0; i < rt->sourcecount; i ++) {
Note: See TracChangeset
for help on using the changeset viewer.