标签:
In libcurl example hiperfifo.c, function fifo_cb uses fscanf(fifo inputstream,...) to read in a string.
rv=fscanf(g->input, "%1023s%n", s, &n);
When the fifo content producer sends two urls continuously with no interval, the fifo_cb will lost the second url.
But if the fifo content producer sends the second url 3ms later, the fifo_cb will not lost it.
With using read (fd,...) instead of fscanf,
read_res = read(fd, &dwMsgPtr, sizeof(dwMsgPtr));
the fifo_cb will not lost the second url even if the fifo content producer sends two urls continuously with no interval.
Using fscanf to read message from FIFO will lost message
标签:
原文地址:http://www.cnblogs.com/flyfish163/p/5424997.html