--- loncom/lonnet/perl/lonnet.pm 2007/03/28 00:12:58 1.852 +++ loncom/lonnet/perl/lonnet.pm 2007/03/28 20:28:31 1.853 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.852 2007/03/28 00:12:58 albertel Exp $ +# $Id: lonnet.pm,v 1.853 2007/03/28 20:28:31 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -145,12 +145,12 @@ sub logperm { } sub create_connection { - my ($server) = @_; + my ($hostname,$lonid) = @_; my $client=IO::Socket::UNIX->new(Peer => $perlvar{'lonSockCreate'}, Type => SOCK_STREAM, Timeout => 10); return 0 if (!$client); - print $client ("$server\n"); + print $client ("$hostname:$lonid\n"); my $result = <$client>; chomp($result); return 1 if ($result eq 'done'); @@ -185,7 +185,7 @@ sub subreply { if($client) { last; # Connected! } else { - &create_connection(&hostname($server)); + &create_connection(&hostname($server),$server); } sleep(1); # Try again later if failed connection. } @@ -7426,7 +7426,11 @@ sub hreflocation { } sub current_machine_domains { - my $hostname=&hostname($perlvar{'lonHostID'}); + return &machine_domains(&hostname($perlvar{'lonHostID'})); +} + +sub machine_domains { + my ($hostname) = @_; my @domains; my %hostname = &all_hostnames(); while( my($id, $name) = each(%hostname)) { @@ -7439,7 +7443,12 @@ sub current_machine_domains { } sub current_machine_ids { - my $hostname=&hostname($perlvar{'lonHostID'}); + return &machine_ids(&hostname($perlvar{'lonHostID'})); +} + +sub machine_ids { + my ($hostname) = @_; + $hostname ||= &hostname($perlvar{'lonHostID'}); my @ids; my %hostname = &all_hostnames(); while( my($id, $name) = each(%hostname)) {