# Buffers to flush? foreach $client ($select->can_write(1)) { # Skip this client if we have nothing to say next unless exists $outbuffer{$client}; eval{ $rv = $client->send($outbuffer{$client}, 0); }; push(@bad_client,$client),next if $@; unless (defined $rv) { # Whine, but move on. warn "I was told I could write, but I can't.\n"; next; } if ( $rv == length $outbuffer{$client} || $! == POSIX::EWOULDBLOCK) { substr($outbuffer{$client}, 0, $rv) = ''; delete $outbuffer{$client} unless length $outbuffer{$client}; } else { # Couldn't write all the data, and it wasn't because # it would have blocked. Shutdown and move on. $self->disconnect_client($client); next; } }