crawfordr has asked for the wisdom of the Perl Monks concerning the following question:
while (1) { # Continously Listening on Port for connections my ($rh_set) = IO::Select->select($read_set, undef, undef, 0); foreach $rh (@$rh_set) { print "Process each handle...\n"; print "Main socket connection..\n"; $ns = $rh->accept(); $read_set->add($ns); }else{ print "Ordinary socket, read...\n"; my $bytecount = sysread($rh, $buf, 1024); $iroam_req_type = substr($buf,0,8); if($buf) { print " *** BEGIN PROCESSING CALL ***"; print "Iroam transaction received:\n"; print "$buf\n"; if ($iroam_req_type =~ /FindMin/){ $find_min_request_rec = $buf; }elsif ($iroam_req_type =~ /PriceCal/){ $price_call_rec = $buf; } pass_transaction_to_iroam_package(); print "Sending Response....\n"; $rh->send($iroam_response_rec); }else { print "Iroam client closed socket..\n"; $read_set->remove($rh); close($rh); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: While(1) using 100% CPU
by ikegami (Patriarch) on Apr 03, 2008 at 21:06 UTC | |
|
Re: While(1) using 100% CPU
by samtregar (Abbot) on Apr 03, 2008 at 17:40 UTC | |
|
Re: While(1) using 100% CPU
by mr_mischief (Monsignor) on Apr 03, 2008 at 17:35 UTC | |
|
Re: While(1) using 100% CPU
by NetWallah (Canon) on Apr 03, 2008 at 17:40 UTC | |
|
Re: While(1) using 100% CPU
by locked_user sundialsvc4 (Abbot) on Apr 08, 2008 at 21:26 UTC |