Re: socket problems

2000-05-31 Thread Chuck Goehring


I had similar problems on Windows NT with mod_perl 1.16, Apache 1.3.3 and
perl 5.00502.  I was connecting to a Linux smtp server from a cgi on an NT
web server.  On NT, (netstat -s) it showed that "Reset Connections"
increased every time the connection failed.  It would work the very first
time after a re-start - then the would fail every time.   Worked fine from
comman-line Perl.  I'm now testing with perl 5.6.0, Apache 1.3.12 and
mod_perl 1.24 and don't have the problem.

Hope this helps.

Chuck Goehring

-Original Message-
From: Reilly, Thomas <[EMAIL PROTECTED]>
To: 'mod_perl' <[EMAIL PROTECTED]>
Date: Wednesday, May 31, 2000 4:22 AM
Subject: socket problems


>Hi,
> i'm using mod_perl to run a Unix domain socket client to connect to
>a server (wriiten in C). When i run the server and run the perl client as a
>stand-alone perl program it connects to the socket just fine and exchanges
>the relevant information. When i put the same lines into a mod_perl
program,
>I keep getting the following error in the error_log:
>
>null:Can't connect to /home/tom/ipc/echo_socket: Connection refused at
>/home/tom/ipc/mpipc.pl line21
>
>Here are the lines i use (which work for a standalone perl program!) in the
>script mpipc.pl
>
>use Apache::Request ();
>use Socket;
>use strict;
>
>my $r = shift;
>my $apr = Apache::Request->new($r);
>
>
> gather info from request obj here!
>
>
>socket(CLIENT,PF_UNIX,SOCK_STREAM,0);
>connect(CLIENT,sockaddr_un("/home/tom/ipc/echo_socket")) or die "Cant
>connect to /home/tom/ipc/echo_socket: $!";
>
>Above line is where the script fails as it can't connect! I set the
>permissions on the socket file to rwx for everybody!
>i.e. chmod 777 echo_socket
>but i still am refused a connection to it!
>(I also know IO::Socket may be an option but when i tried using it in a
>standalone perl program it absolutely refuses
>to connect to the C server)
>My question is does anybody know why i can't connect to this socket from a
>mod-perl script even though the above code connects fine from an ordinary
>perl program?
>
>Apache/1.3.12 (Red Hat linux)
>mod_perl/1.21
>Perl 5.00503
>
>Any help would be greatlt appreciated!
>
>Thomas.
>
>
>
>
>Thomas Reilly
>Software Consultant,
>
>Distributed Software Consultancy Ltd.,
>Ballybrit Business Park,Galway,Ireland.
>Tel: +353 (91) 760541 Fax: +353 (91) 760542
>e-mail: [EMAIL PROTECTED]
>web: http://www.dscie.com
>




socket problems

2000-05-31 Thread Reilly, Thomas

Hi,
i'm using mod_perl to run a Unix domain socket client to connect to
a server (wriiten in C). When i run the server and run the perl client as a
stand-alone perl program it connects to the socket just fine and exchanges
the relevant information. When i put the same lines into a mod_perl program,
I keep getting the following error in the error_log:

null:Can't connect to /home/tom/ipc/echo_socket: Connection refused at
/home/tom/ipc/mpipc.pl line21

Here are the lines i use (which work for a standalone perl program!) in the
script mpipc.pl

use Apache::Request ();
use Socket;
use strict;

my $r = shift;
my $apr = Apache::Request->new($r);


 gather info from request obj here!


socket(CLIENT,PF_UNIX,SOCK_STREAM,0);
connect(CLIENT,sockaddr_un("/home/tom/ipc/echo_socket")) or die "Cant
connect to /home/tom/ipc/echo_socket: $!";

Above line is where the script fails as it can't connect! I set the
permissions on the socket file to rwx for everybody!
i.e. chmod 777 echo_socket
but i still am refused a connection to it!
(I also know IO::Socket may be an option but when i tried using it in a
standalone perl program it absolutely refuses
to connect to the C server)
My question is does anybody know why i can't connect to this socket from a
mod-perl script even though the above code connects fine from an ordinary
perl program?

Apache/1.3.12 (Red Hat linux)
mod_perl/1.21
Perl 5.00503

Any help would be greatlt appreciated!

Thomas.




Thomas Reilly
Software Consultant,

Distributed Software Consultancy Ltd.,
Ballybrit Business Park,Galway,Ireland.
Tel: +353 (91) 760541 Fax: +353 (91) 760542
e-mail: [EMAIL PROTECTED]
web: http://www.dscie.com