more robust: 1) ignore EAGAIN, 2) ignore decoder error