Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to take the HTTP::Daemon::SSL and make it threaded. The SSL Daemon itself runs. The threaded Daemon itself runs... but guess what... the threaded SSL daemon doesnt -.- Is it even possible to du such a thing? Here is what I got:
my $d = HTTP::Daemon::SSL->new(LocalAddr => localhost, LocalPort => 90 +90, ReuseAddr => 1) || die "Couldn't start server! Reason: $!"; print "Serving as (".$$.") on ".$d->sockhost.":".$d->sockport."\n"; while (my $c = $d->accept) { threads->create(\&handle, $c)->detach(); } sub handle { my $c = shift; my $r = $c->get_request; if ($r) { ... } else { $c->send_error(); } $c->close; undef($c); }
doing this with the HTTP::Daemon works fine. If I take the SSL-Version I get segmentation faults. Guess it has to do with the accept() of the connection.
Another strange thing is that the SSL Daemon always terminates when there is a non-SSL connection (attemping to connect via http) shouldnt be the rule should it?
Hope someone can haelp me, thx in advance.
|
|---|