Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 29395 invoked from network); 12 Jan 2004 03:40:15 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 12 Jan 2004 03:40:15 -0000 Received: (qmail 70038 invoked by uid 500); 12 Jan 2004 03:39:45 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 70024 invoked by uid 500); 12 Jan 2004 03:39:45 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 70011 invoked from network); 12 Jan 2004 03:39:45 -0000 Message-ID: From: John DeBenedette To: "'modperl@perl.apache.org'" Subject: mod_perl 1.99_13 - IO:Socket::INET works only once - other side d efunct thereafter Date: Sun, 11 Jan 2004 22:39:44 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 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 = "192.168.0.3"; $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>; close($conpool); exit; ----------------------------------------------------------------- Above is talking to a guy (on AIX 4.3.3.10 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); } close($server); $dbsession->close; exit; Thanks in advance! John ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ---------------------------------------------------- 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 Postmaster@INTTRA.com and permanently delete the original, any attachments, any copies thereof, and any printouts thereof. -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html