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); } } }