The main concerns are: whether or not ‘unread_bytes’ is actually populated without an fread(), and also whether or not a loop is needed with a timeout to check fread() multiple times (with an assigned timeout) or to check ‘unread_bytes’ several times within X seconds before aborting.
The main concerns are: whether or not ‘unread_bytes’ is actually populated without an fread(), and also whether or not a loop is needed with a timeout to check fread() multiple times (with an assigned timeout) or to check ‘unread_bytes’ several times within X seconds before aborting.