version 1.852, 2007/03/28 00:12:58
|
version 1.853, 2007/03/28 20:28:31
|
Line 145 sub logperm {
|
Line 145 sub logperm {
|
} |
} |
|
|
sub create_connection { |
sub create_connection { |
my ($server) = @_; |
my ($hostname,$lonid) = @_; |
my $client=IO::Socket::UNIX->new(Peer => $perlvar{'lonSockCreate'}, |
my $client=IO::Socket::UNIX->new(Peer => $perlvar{'lonSockCreate'}, |
Type => SOCK_STREAM, |
Type => SOCK_STREAM, |
Timeout => 10); |
Timeout => 10); |
return 0 if (!$client); |
return 0 if (!$client); |
print $client ("$server\n"); |
print $client ("$hostname:$lonid\n"); |
my $result = <$client>; |
my $result = <$client>; |
chomp($result); |
chomp($result); |
return 1 if ($result eq 'done'); |
return 1 if ($result eq 'done'); |
Line 185 sub subreply {
|
Line 185 sub subreply {
|
if($client) { |
if($client) { |
last; # Connected! |
last; # Connected! |
} else { |
} else { |
&create_connection(&hostname($server)); |
&create_connection(&hostname($server),$server); |
} |
} |
sleep(1); # Try again later if failed connection. |
sleep(1); # Try again later if failed connection. |
} |
} |
Line 7426 sub hreflocation {
|
Line 7426 sub hreflocation {
|
} |
} |
|
|
sub current_machine_domains { |
sub current_machine_domains { |
my $hostname=&hostname($perlvar{'lonHostID'}); |
return &machine_domains(&hostname($perlvar{'lonHostID'})); |
|
} |
|
|
|
sub machine_domains { |
|
my ($hostname) = @_; |
my @domains; |
my @domains; |
my %hostname = &all_hostnames(); |
my %hostname = &all_hostnames(); |
while( my($id, $name) = each(%hostname)) { |
while( my($id, $name) = each(%hostname)) { |
Line 7439 sub current_machine_domains {
|
Line 7443 sub current_machine_domains {
|
} |
} |
|
|
sub current_machine_ids { |
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 @ids; |
my %hostname = &all_hostnames(); |
my %hostname = &all_hostnames(); |
while( my($id, $name) = each(%hostname)) { |
while( my($id, $name) = each(%hostname)) { |