T
Taras Kudla
hi to everybody,
i am new in perl and writing a simple server, and i have a problem,
for handling client connections i am using a while script, processor
usage during script running is 100%.
here is piece of code:
.....
my $socket=IO::Socket::INET->new(LocalPort =>
$port,Listen=>SOMAXCONN,Reuse=>1) or die "Cannot create listen socket:
$!";
......
sub handle_connection {
my $socket=shift;
....
while(1) {
my $answ=<$socket>;
}
}
can anyone suggest some other methods of connection handling or some
piece of code maybe.
thanks
i am new in perl and writing a simple server, and i have a problem,
for handling client connections i am using a while script, processor
usage during script running is 100%.
here is piece of code:
.....
my $socket=IO::Socket::INET->new(LocalPort =>
$port,Listen=>SOMAXCONN,Reuse=>1) or die "Cannot create listen socket:
$!";
......
sub handle_connection {
my $socket=shift;
....
while(1) {
my $answ=<$socket>;
}
}
can anyone suggest some other methods of connection handling or some
piece of code maybe.
thanks