while (my @allhandles = IO::Select::select($links, undef, $links) {