perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John DeBenedette <>
Subject mod_perl 1.99_13 - IO:Socket::INET works only once - other side d efunct thereafter
Date Mon, 12 Jan 2004 03:39:44 GMT
SERVER_SOFTWARE = "Apache/2.0.48 (Win32) mod_perl/1.99_13-dev Perl/v5.8.2
PHP/4.3.4 mod_ssl/2.0.48 OpenSSL/0.9.7c" 

The following works flawlessly under CGI but when attempting under Registry
as module or PerlRun as script, it works once perfectly, then continues to
work with no discernable error but causes the listening server's accept()
process to go <defunct> and therefore $resp comes back empty and application
fails on its face.  was last tried un-handlerized under PerlRun to make
isolation simpler but works there too, just kills (kind of) his socket-mate
and goes on his merry way like everything is cool.  restart apache and you
get another go at it - but just 1.
my ($poolport, $host, $conpool, $cmd, $session_data, $resp);
$poolport = "7867";
$host = "";
$session_data = "yada yada";
$cmd = "watch seinfeld";
$conpool = IO::Socket::INET->new(PeerAddr => $dbhost, PeerPort =>
$dbpoolport, Proto => "tcp", Type => SOCK_STREAM) > or die "could not
connect to $host on $poolport : $@\n"; 
print $conpool $session_data;
print $conpool $cmd;
print $resp = <$conpool>;
Above is talking to a guy (on AIX straight perl 5.6.0 with no web
server, just a forked server listening) - this exact same server and code
below listens/works with above when above uses CGI.  The perl code from the
other box is shown below:
use IO::Socket;
$server_port = 7867;
$server = IO::Socket::INET->new(LocalPort => $server_port, > Type =>
SOCK_STREAM, > Proto => "tcp", > Reuse => 1, > Listen => 10) > or die
"Nothing doing on port $server_port : $@\n";
  while (1) { 
    $client = $server->accept();# or last; # craps out from mod_perl with or
without - he goes defunct an un-natural way without telling a soul
    $session_data = <$client>; 
    $dbcmd = <$client>;
    print $client $dbsession->cmd($dbcmd);

Thanks in advance!

This e-mail and any attachments thereto are intended only for use by the
addressee(s) named herein and may contain proprietary and/or confidential
information. If you are not the intended recipient of this e-mail, you are
hereby notified that any dissemination, distribution or copying of this
e-mail, and any attachments thereto, is strictly prohibited. If you have
received this e-mail in error, please immediately notify and permanently delete the original, any attachments,
any copies thereof, and any printouts thereof.

Reporting bugs:
Mail list info:

View raw message