/[Frey]/trunk/lib/Frey/Test.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Test.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 216 by dpavlin, Fri Oct 31 22:39:48 2008 UTC revision 938 by dpavlin, Tue Jan 6 13:00:20 2009 UTC
# Line 24  our $kid_out; Line 24  our $kid_out;
24  sub _fork {  sub _fork {
25          my ($self,$filename) = @_;          my ($self,$filename) = @_;
26          $ENV{FREY_PORT} = int( 16000 + rand(1000) );          $ENV{FREY_PORT} = int( 16000 + rand(1000) );
27          $filename ||= './bin/server.pl';          $filename ||= './bin/continuity-server.pl';
28          $kid_pid = open($kid_out, '-|');          $kid_pid = open($kid_out, '-|');
29          die "Unable to fork!" unless defined($kid_pid);          die "Unable to fork!" unless defined($kid_pid);
30          if($kid_pid) {          if($kid_pid) {
# Line 46  sub start_server { Line 46  sub start_server {
46          $self->_fork unless $kid_out;          $self->_fork unless $kid_out;
47          my $host = '127.0.0.1:' . $ENV{FREY_PORT};          my $host = '127.0.0.1:' . $ENV{FREY_PORT};
48          warn "## waiting for $host to start";          warn "## waiting for $host to start";
49          while ( ! IO::Socket::INET->new( $host ) ) {          if ( ! IO::Socket::INET->new( $host ) ) {
50                  warn ".";                  die "can't start server on $host";
                 sleep 1;  
51          }          }
52          return "http://$host";          return "http://$host";
53  }  }

Legend:
Removed from v.216  
changed lines
  Added in v.938

  ViewVC Help
Powered by ViewVC 1.1.26