Fixed infinite blocking when waiting for packets that will never come.