sub server_run_single() { my ($server,$keepAlive,$i,$loop,$verbose) = @_; my $d_count = 0; my $result = 0; print "Running Server loop $i of $loop.\n" if $verbose; # accept and process connections my $client = $server->accept( ); $clientCount = &add_Clientcount($verbose); print "Connected - " . &id_client($client) . "\n"; while ( defined (my $data_recv = <$client>) ) { if ($data_recv =~ m/discon/) { $clientCount = &subt_Clientcount($verbose); # Get out of this loop close($client); } print STDOUT $data_recv if $verbose; print $client "You said - $data_recv\n" if $verbose; } print "Exiting loop $i of $loop.\n" if $verbose; return $result; }