while (1) {
print "yo\n";
while ( my @handles = $self->{daemon}->can_read(1) ) {
foreach ( @handles ) {
if ($_ == $self->{listener}) {
my $new_sock = $self->{listener}->accept or die "accept: $!";
$self->{daemon}->add( $new_sock);
}
else {
my @rawmsg = $_->getlines;
print @rawmsg;
#$_->close;
}
}
}
}
####
yo
yo
yo
yo
message from client
####
yo
yo
yo
yo
message from client
yo
yo
yo