Hello,
Right after I close FIFO on the producer side, the app on the consumer side gets into an endless loop. select() returns that FIFO is ready to read. Below is the excerpt from the consumer code. The FIFO is opened "blocking" on both ends.
Could someone help me. Thank you!
Code:FifoClass fifo_r = FifoClass("/tmp/FIFO_READ"); int fdr = fifo_r.OpenR(); // this->fd = open(name.c_str(), O_RDONLY , 0); for(int i=0; ;i++) { FD_ZERO(&rset); FD_SET(fdr, &rset); maxfdp = max(fdr, 0)+1; select(maxfdp, &rset, NULL, NULL, NULL); // Read from FIFO. if (FD_ISSET(fdr, &rset)) { ret = fifo_r.Read(&message); message += message + " *** " + to_string(i) + "."; cout << message << endl << flush; } } // for()




Reply With Quote