Re: ModPerl package Q

2001-06-20 Thread Perrin Harkins

 Well, this is the last time I am going to bring this up. I am on Apache
NT,
 and I have the following .pm file that I believe I localized everything in
 order to create a socket. The code below does work.  But it never makes a
 new socket. As you can see I print out the IO::Socket::GLOB and it shows
the
 same 'reference' 10xff036c each time through. I realize this is because I
am
 not closing and undef the $sock. (see the commented close and undef
towards
 the end). But this works. Except if I shut down the machine I am calling
the
 socket on. Then it dies and never comes back unless I reboot apache. Not a
 good work position to get a web site into.

 But here is the catch. If I do close the socket and either undef or even
 leave that commented out, I only get one send to the socket, and one
reply,
 but it never sends another reply to the server and never gets another
 response back? But yes, it creates a new socket ref each time?

It looks to me like you have a problem with scoping and closures.  Try
making $sock a global, i.e. change my $sock; to use vars qw($sock);.
Then put your close and undef stuff back in.

- Perrin




Re: ModPerl package Q

2001-06-20 Thread Joshua Chamas

Purcell, Scott wrote:
 
 Hello,
 Well, this is the last time I am going to bring this up. I am on Apache NT,
 and I have the following .pm file that I believe I localized everything in
 order to create a socket. The code below does work.  But it never makes a
 new socket. As you can see I print out the IO::Socket::GLOB and it shows the
 same 'reference' 10xff036c each time through. I realize this is because I am
 not closing and undef the $sock. (see the commented close and undef towards
 the end). But this works. Except if I shut down the machine I am calling the
 socket on. Then it dies and never comes back unless I reboot apache. Not a
 good work position to get a web site into.
 

Set in httpd.conf ThreadsPerChild 1

This problem should go away.  Its a bug I ran into for the first time
a few years back, and seems to have to do with any network sockets
that you might open.  

See 
http:[EMAIL PROTECTED]
for my original post on this, showing our similar plights!

--Josh
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks - Web Link Checking  Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051