my ( $self, $class, $port, $host, $options ) = @_;
$options ||= {};
-
+
$self->options($options);
if ($options->{background}) {
)
or die "Couldn't create daemon: $!";
+ $port = $daemon->sockport();
+
my $url = "http://$host";
$url .= ":$port" unless $port == 80;
}
$self->_handler( $class, $port, $method, $uri, $protocol );
-
+
if ( $self->_has_write_error ) {
close Remote;
-
+
if ( !defined $pid ) {
next LISTEN;
}
close Remote;
}
}
-
+
$daemon->close;
-
+
DEBUG && warn "Shutting down\n";
if ($restart) {
### those include dirs upon re-exec. So add them to PERL5LIB, so they
### are available again for the exec'ed process --kane
use Config;
- $ENV{PERL5LIB} .= join $Config{path_sep}, @INC;
-
+ $ENV{PERL5LIB} .= join $Config{path_sep}, @INC;
+
exec $^X, $0, @{ $options->{argv} };
}