If you know there are no more bytes in the buffer, then you can ignore that error. That is, if the packet size is fixed, and you are receiving correctly, you don't have to reach the timeout. Also, you can set the timeout to a value less than 10 seconds, if you know that all transactions occur before the time is up.