Don't use hardcoded ports.

This commit is contained in:
Micah Cowan
2008-06-12 02:18:35 -07:00
parent 484ba18aa7
commit f0f56db5cb
44 changed files with 152 additions and 93 deletions

View File

@@ -30,17 +30,26 @@ my $VERSION = 0.01;
}
sub _setup_server {}
sub _setup_server {
my $self = shift;
$self->{_server} = HTTPServer->new (LocalAddr => 'localhost',
ReuseAddr => 1)
or die "Cannot create server!!!";
}
sub _launch_server {
my $self = shift;
my $synch_func = shift;
my $server = HTTPServer->new (LocalAddr => 'localhost',
LocalPort => '8080',
ReuseAddr => 1) or die "Cannot create server!!!";
$server->run ($self->{_input}, $synch_func);
$self->{_server}->run ($self->{_input}, $synch_func);
}
sub _substitute_port {
my $self = shift;
my $ret = shift;
$ret =~ s/{{port}}/$self->{_server}->sockport/eg;
return $ret;
}
1;