Thread Problem mit Socket Server, reagiert zu langsam
(7 answers)
Opened by Carsten at 2010-06-06 23:29 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 while(my $new_sock = $sock->accept()) { my $buffer; my $len = read $new_sock, $buffer, 4096; for(;;) { if(defined $len) { last unless $len; print "Read $len chars\n"; print "Data [" . substr($data, 0, $len) ."]\n"; } else { warn "An error occured while reading: $!\n"; last; } $len = read $new_sock, $buffer, 4096; } } |