- Timestamp:
- Feb 15, 2010 5:32:05 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 3132419
- Parents:
- 6d985c0
- Location:
- fedkit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/active_config.pl
r6d985c0 r1899afd 44 44 my $f = new IO::File($iface_file) || die "Can't open $iface_file: $!\n"; 45 45 my $ifnum = 0; 46 47 print "Waiting for ssh on $peer\n"; 48 gateway_lib::wait_for_port($peer, 22, 60*60) || 49 die "ssh never came up on $peer\n"; 46 50 47 51 while (<$f>) { -
fedkit/gateway_lib.pm
r6d985c0 r1899afd 16 16 use IO::File; 17 17 use IO::Pipe; 18 use IO::Socket; 18 19 19 20 use File::Temp; … … 244 245 } 245 246 246 # untested247 247 sub read_config { 248 248 my($file, $map) = @_; … … 317 317 } 318 318 319 sub wait_for_port { 320 my($addr, $port, $timeout, $sleep) = @_; 321 my $start = time(); 322 $sleep = 5 unless $sleep; 323 die "Need both address and port\n" unless $addr && $port; 324 325 my $s; 326 327 while (!$s) { 328 if (!($s = new IO::Socket(Domain => &AF_INET, PeerAddr => $addr, 329 PeerPort => $port))) { 330 if ($timeout and time() - $start > $timeout) { 331 return undef; 332 } 333 else { sleep($sleep); } 334 } 335 } 336 $s->close(); 337 return 1; 338 339 } 340 341 319 342 1;
Note: See TracChangeset
for help on using the changeset viewer.