Use select for a reliable timeout in avalon read and don't read 1 byte at a time, optimising read loop.