My application checks for incoming data in a TCP socket by calling poll() with zero timeout. 99% of the time it works fine, when there are data on the socket it sets the POLLIN flag. Sometimes however there are data on the socket(I see the message on wireshark), but poll() returns 0(timed out) and does not set the POLLIN flag. It will set the POLLIN flag after several seconds when another message comes.
Is that normal behavior? Does poll() always checks for incoming data at least once before timing out?
According to the answers in another question, Linux man pages are not very clear about that.